This reference listing notes some of the most commonly used CSS properties.
The listing below is not intended to be a comprehensive list of all existing properties. Listed are CSS properties that were defined as part of CSS1 and CSS2 only.
CSS properties can be applied in many ways to different HTML element. Examples below are based on generic use only and do not cover all valid property value / property name combinations.
Box Model Properties
|The float property defines if a |
|This property defines the width of a |
|Defines the height of a |
|Defines the margin for all four sides in one declaration. First value relates to top margin, second value to right margin, third value to bottom margin and fourth value to left margin, e.g.: |
|Defines the padding for all four sides in one declaration. First value relates to top padding, second value to right padding, third value to bottom padding and fourth value to left padding, e.g.: |
|Allows for an element to be displayed as inline element (e.g. |
|The clear property defines the side(s) that another floating HTML element is/are not allowed to be positioned, e.g.: |
Background And Border Properties
|This property defines the background color of a |
|Allows the use of an image as background image of a |
|Sets the position of a background image, e.g.:|
|Specifies whether a background image is repeated (tiled) and how it is repeated, e.g.:|
By default, a background-image is repeated vertically and horizontally.
|Defines the border for all four sides of a |
Textual Content Properties
|Defines a prioritised list of font names and/or generic font family names, e.g.:|
|The size of the displayed font, e.g.: |
|Defines the text colour. The colour may be specified using one of the predefined HTML color names, hex value or RGB value, e.g.: |
|Weight of the displayed font, e.g. |
|Defines the font style, e.g. |
|Sets the text decoration, e.g. |
|Aligns content, not only text, within an HTML element, e.g. |
|Indents the first line of a block of text, e.g.: |
|Sets the spacing between individual character, e.g.: |
|Sets the spacing between individual words, e.g.: |
|Sets the height of a text line, e.g.: |
|Defines all the list style properties in one declaration.|
|Defines the image used as a list style marker, e.g.:|