CSS – List Of CSS Properties
In this chapter I will give you a partially complete list of CSS properties.
My aim is to have a maximum amount of CSS properties on this page. We have already seen a lot of them in the lessons, but there are also properties that we haven’t had the time to see in the tutorials. Most of them are quite rare but easy to use.
The list is only partial because I don’t want to make a complete list of CSS properties that exist. There are too many, and a lot of them are never used.
Therefore, I prefer to concentrate on the main ones, and as you’ll see, there are still a lot of them
Properties For Text Formatting
In this part I’ll put most of the properties used for text formatting.
What is text formatting ? It’s everything that has to do with the shape and size of the text : bold, italic, underlined, font, alignment etc…
Font, Size & Decoration
| Type | Property | Possible Values |
|---|---|---|
| Name of the font | font-family |
Indicate the names of the fonts in the order you want them : Code : CSS font-family: font1, font2, font3; If the visitor has font1 on his computer, font1 will be used. If not, the computer will try font2 then font3 etc. Code : CSS font-family: "Arial Black", Arial, Verdana, serif; |
| Size of the text | font-size |
Indicates the size of the text.
|
| Bold | font-weight |
|
| Italic | font-style |
|
| Decoration | text-decoration |
|
| Small capitals | font-variant |
|
| Capitals | text-transform |
|
| Mega Property | font |
Indicate in the order you wish the values for font-weight, font-style, font-size, font-variant, font-family. Example : Code : CSS font: bold, 16px, Arial; |
Alignment
| Type | Property | Possible Values |
|---|---|---|
| Horizontal alignment | text-align |
|
| Vertical alignment | vertical-align |
Can be used in the cells of a table or in inline elements that are contained inside inline elements :
|
| Distance between lines | line-height | Indicate a value in pixels (px) or a percentage (%) |
| Indentation | text-indent |
Indicate a value in pixels for the indentation. |
| Line break | white-space |
|
Background Colour Properties
| Type | Property | Possible Values |
|---|---|---|
| Text colour | color |
Indicates the colour with one of the following methods :
|
| Background colour | background-color | Works the same as color. |
Background Image
| Type | Property | Possible Values |
|---|---|---|
| Background image | background-image |
Indicate the URL of the image (absolute or related URL) :
background-image: url("images/bg.png"); /* related address */
background-image: url("http://www.mysite.com/images/bg.png"); /* absolute address */
|
| Fixed background | background-attachment |
|
| Repeat the background | background-repeat |
|
| Position of the background | background-position |
There are 2 different methods :
|
| Mega background property | background |
Indicate one or several values from background-image, background-repeat, background-attachment, background-position. Code : CSS
/* the background bg.png will be shown in the top right and won't be repeated */
background: url("images/bg.png") no-repeat fixed top right;
|
Box Properties
Dimensions
| Type | Property | Possible Values |
|---|---|---|
| Width | width | Value in px, % or auto(by default, depends on the text or content inside) |
| Height | height | Works like width |
| Set minimum width | min-width | Indicate a value in pixels for example. |
| Set maximum width | max-width | Same |
| Set minimum height | min-height | Same |
| Set maximum height | max-height | Same |
Outside Margins
| Type | Property | Possible Values |
|---|---|---|
| Top margin | margin-top | Indicate a value like 20px, 1.5em… |
| Left margin | margin-left | Same |
| Right margin | margin-right | Same |
| Bottom margin | margin-bottom | Same |
| Margin mega property | margin |
Indicate between 1 and 4 values. Depending on the number of values the meaning changes :
|
Inside Margins
| Type | Property | Possible Values |
|---|---|---|
| Top padding | padding-top | Indicate a value like 20px, 1.5em… |
| Left padding | padding-left | Same |
| Right padding | padding-right | Same |
| Bottom padding | padding-bottom | Same |
| Padding mega property | padding |
Indicate between 1 and 4 values. Depending on the number of values the meaning changes :
|
Borders
| Type | Property | Possible Values |
|---|---|---|
| Width of the border | border-width | Indicate a value in pixels (px) |
| Colour of the border | border-color | Indicate a colour in English, hexadecimal or RGB |
| Type of border | border-style |
|
| Left border | border-left |
Indicate the colour, thickness and type of border for the left border. Code : CSS border-left: 2px inset blue; |
| Top border | border-top | Same |
| Right border | border-right | Same |
| Bottom border | border-bottom | Same |
| Border mega property | border | Indicate the colour, thickness and type of border for every side. |
Properties For Positioning & Displaying
Displaying
| Type | Property | Possible Values |
|---|---|---|
| Type of element | display |
|
| Change the visibility | visibility |
|
| Only show part of an element | clip |
Indicate 4 values like this : Code : CSS clip: rect(value1, value2, value3, value4); Allows us to only show a part of an element. rect() allows us to insert the coordinates of the rectangle that will be shown. |
| Limit visibility | overflow |
|
Positioning
| Type | Property | Possible Values |
|---|---|---|
| Floating | float |
|
| Stop floating | clear |
|
| Type of positioning | position |
|
| Position in relation to the top | top | Value in px, em, %… To be used for absolute, fixed or related positioning. |
| Position in relation to the bottom | bottom | Same |
| Position in relation to the left | left | Same |
| Position in relation to the right | right | Same |
| Order of display | z-index |
In the case of absolute positioning for example, if 2 elements overlap, z-index allows us to say which element should be shown on top. For example, if 2 elements are using absolute positioning and they overlap with a z-index of 10 for one, and z-index of 20 for the other, the one with 20 will be at the front. |
List Properties
| Type | Property | Possible Values |
|---|---|---|
| List style | list-style-type |
|
| Indent list | list-style-position |
|
| Personalised bullet point | list-style-image |
Indicate the URL of the image which will act as a bullet point. Example : Code : CSS
list-style-image: url("images/point.jpg");
|
| List mega property | list-style |
You can reunite the values of list-style-type, list-style-position and list-style-image. You don’t have to put values for everything and the order doesn’t matter. Code : CSS list-style: square inside; |
Table Properties
| Type | Property | Possible Values |
|---|---|---|
| Type of border | border-collapse |
|
| Display empty cells | empty-cells |
|
| Position of the title | caption-side |
Indicate the position of the table’s title, defined with the <caption> tag :
|
Other Properties
| Type | Property | Possible Values |
|---|---|---|
| Mouse cursor shape | cursor |
|
Leave a Reply