basics of website design banner photo

HTML

HTML 5

CSS 2.1

CSS 3

Reference





CSS Property Reference

This reference includes all the properties included in the CSS 2.1 specification which became a W3C Recommendation on 7th June 2011 in addition to the CSS 3 opacity property which became part of the CSS specification on the same date.

NOTE:CSS Aural Properties are part of the specification but user agents are not required to implement them in order to comply with the specification and they are explained on the css aural properties page.

Background Properties

Property Definition
background Sets all the background properties in one declaration.
background-attachment Sets whether a background image is fixed or scrolls.
background-color Sets the background colour of an element.
background-image Sets the background image of an element.
background-position Sets the initial position of a background image.
background-repeat If a background image has been used this property sets if and how it repeats.

Border and Outline Properties

Property Definition
border Sets all the border properties in one declaration.
border-color Sets the colour for all four borders of an element.
border-style Sets the style for all four borders of an element.
border-width Sets the width for all four borders of an element.
border-bottom Defines width, style and colour for the bottom border of an element in one declaration.
border-bottom-color Sets the colour of the bottom border of an element.
border-bottom-style Sets the style for the bottom border of an element.
border-bottom-width Sets the width for the bottom border of an element.
border-left Sets all left border properties of an element in one declaration.
border-left-color Sets the color for the left border of an element.
border-left-style Sets the style for the left border of an element.
border-left-width Sets the width for the left border of an element.
border-right Sets all right border properties of an element in one declaration.
border-right-color Sets the colour for the right border of an element.
border-right-style Sets the style for the right border of an element.
border-right-width Sets the width for the right border of an element.
border-top Sets all top border properties of an element in one declaration.
border-top-color Sets the colour for the top border of an element.
border-top-style Sets the style for the top border of an element.
border-top-width Sets the width for the top border of an element.
outline Sets all the outline properties of an element in one declaration.
outline-color Sets the outline colour of an element.
outline-style Sets the outline style of an element.
outline-width Sets the outline width of an element.

Margins and Padding

Property Definition
margin Sets all four margins of an element.
margin-top Sets the top margin of an element.
margin-left Sets the left margin of an element.
margin-right Sets the right margin of an element.
margin-bottom Sets the bottom margin of an element.
padding Sets the padding on all four sides of an element.
padding-top Sets the top padding of an element.
padding-left Sets the left padding of an element.
padding-right Sets the right padding of an element.
padding-bottom Sets the bottom padding of an element.

Font Properties

Property Definition
font Sets all the font properties in one declaration.
font-family Sets the font family of an element.
font-size Sets the font size of an element.
font-style Sets the font style of an element.
font-variant Sets the font variant of an element.
font-weight Sets the font weight of an element.

Text Properties

Property Definition
color Sets the colour of text.
direction Sets the direction of text.
text-align Sets the horizontal alignment of text.
text-decoration Defines the decoration given to text.
text-indent Sets the level of indentation of the first line of text in a block.
text-transform Sets the capitalization of text in an element.
line-height Sets the line height of text in an element.
letter-spacing Sets the distance between letters in text.
unicode-bidi Allows the normal text direction to be overridden.
word-spacing Sets the spacing between words in text in an element.
vertical-align Sets the vertical alignment of an element.
white-space Defines how white space around an element is dealt with.

Dimension Properties

Property Definition
height Sets the height of an element.
min-height Sets the minimum height of an element.
max-height Sets the maximum height of an element.
width Sets the width of an element.
min-width Sets the minimum width of an element.
max-width Sets the maximum width of an element.

List Properties

Property Definition
list-style Sets all the list properties for an element in one declaration.
list-style-image Sets the list item marker as an image.
list-style-position Sets where the list item markers will appear.
list-style-type Sets the type of the list item markers.

Table Properties

Property Definition
border-collapse Sets whether table borders should be collapsed or not.
border-spacing Sets the distance between borders of adjacent cells.
caption-side Defines where a table caption is positioned.
empty-cells Defines behaviour for borders and backgrounds around empty cells.
table-layout Controls the algorithm used to layout a table.

Positioning and Display Properties

Property Definition
bottom Sets the bottom margin for a positioned box.
left Sets the left margin for a positioned box.
right Sets the right margin for a positioned box.
top Sets the top margin for a positioned box.
display Defines the type of box an element should generate.
position Sets the type of positioning for an element.
float Defines whether or not a box is floated.
clear Defines how an element displays in relation to previous floated content.
cursor Specifies the type of cursor to be displayed.
clip Defines clipping behaviour for an absolutely positioned element.
overflow Defines what happens when content overflows an element's box.
opacity Sets the opacity of an element. CSS3 PROPERTY
visibility Defines whether an element is visible or not.
z-index Defines the stack order of an element.

Print Properties

Property Definition
page-break-after Sets the page-break conditions after an element.
page-break-before Sets the page-break conditions before an element.
page-break-inside Sets the page-break conditions inside an element.
orphans When a page-break is inside an element this property sets the minimum number of lines that must be left at the bottom of a page.
widows When a page-break is inside an element this property sets the minimum number of lines that must be left at the top of a page.

Generated Content Properties

Property Definition
content Insert content with the :before or :after pseudo-elements.
counter-increment Increments one or more counters.
counter-reset Used to create or reset one or more counters.
quotes Sets the type of quotes for embedded quotations.