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-typeproperty specifies the type of list item marker. - The
list-style-imageproperty specifies an image as the list item marker - The
list-style-positionproperty specifies the position of the list-item markers (bullet points). - The
list-style-type:noneproperty can also be used to remove the markers/bullets. Note that the list also has default margin and padding. To remove this, addmargin:0andpadding:0to <ul> or <ol>: - The
list-styleproperty 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
borderproperty. - The
border-collapseproperty sets whether the table borders should be collapsed into a single border - Width and height of a table are defined by the
widthandheightproperties. - The
text-alignproperty sets the horizontal alignment (like left, right, or center) of the content in <th> or <td>. - The
vertical-alignproperty 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
paddingproperty on <td> and <th> elements. - Add the
border-bottomproperty to <th> and <td> for horizontal dividers
- Use the
:hoverselector on <tr> to highlight table rows on mouse over - For zebra-striped tables, use the
nth-child()selector and add abackground-colorproperty to all even (or odd) table rows