CSS Properties
Color and background properties
Explore color • background • background-color • background-image • background-origin • background-position • background-repeat • background-size
Color properties: color, opacity
Font properties
Explore font • font-family • font-size • font-style • font-variant • font-weight
Text properties
Explore color • direction • letter-spacing • line-height • text-align • text-decoration • text-indent • text-shadow • text-transform • text-overflow • vertical-align • white-space • word-spacining
List properties
- The
list-style-type
property specifies the type of list item marker. - The
list-style-image
property specifies an image as the list item marker - The
list-style-position
property specifies the position of the list-item markers (bullet points). - The
list-style-type:none
property can also be used to remove the markers/bullets. Note that the list also has default margin and padding. To remove this, addmargin:0
andpadding:0
to <ul> or <ol>: - The
list-style
property is a shorthand property. It is used to set all the list properties in one declaration: - We can also style lists with colors, to make them look a little more interesting.
Table properties
- To specify table borders in CSS, use the
border
property. - The
border-collapse
property sets whether the table borders should be collapsed into a single border - Width and height of a table are defined by the
width
andheight
properties. - The
text-align
property sets the horizontal alignment (like left, right, or center) of the content in <th> or <td>. - The
vertical-align
property sets the vertical alignment (like top, bottom, or middle) of the content in <th> or <td>. - To control the space between the border and the content in a table, use the
padding
property on <td> and <th> elements. - Add the
border-bottom
property to <th> and <td> for horizontal dividers
- Use the
:hover
selector on <tr> to highlight table rows on mouse over - For zebra-striped tables, use the
nth-child()
selector and add abackground-color
property to all even (or odd) table rows