Note: selector means to use the required selector

Note: rule means to use the required css rule(s)

Note: comments in css: /* I'm a comment! */

Note: comments in html: <!-- I'm a comment! -->

Individual Properties

css
property:value;

html
atribute="values"

add a style rule to display the header, article, aside, figure, figcaption, hgroup, section, and nav elements as blocks
header, article, aside, figure, figcaption, hgroup, section, nav {display: block;}

set default style for every element
body * {rule;}

style rule for the page body
body {rule;}

removing underlining from hypertext link
selector {text-decoration: none;}

for every list item in the navigation horizontal (class) list
nav.horizontal li {rule;}

for every list hypertext link in the navigation horizontal (class) list
nav.horizontal li a

for h1 headers that are direct children of main (id) section
#main > h1 {rule;}

set scroll bars in aside
aside {overflow: auto;}

use white-space property
aside {white-space: nowrap}


background-color: color

background-image: url(url);

background-repeat: type;type: repeat-x, repeat-y, no-repeat, round, space

background-position: horizontal vertical;

background-attachment: type;type: scroll, fixed, local

background-size: width height;

background-clip: box; box: content-box, padding-box, border-box

background-origin: box;box: content-box, padding-box, border-box


Shorthand Properties

background shorthand
background: background-color background-image background-repeat background-attachment background-position;

font shorthand
font: font-style font-variant font-weight font-size line-height font-family

margin shorthand
margin: margin-top margin-right margin-bottom margin-left

padding shorthand
padding: padding-top padding-right padding-bottom padding-left

border shorthand
border: border-width border-style color

list-style
list-style: list-style-type list-style-position list-style-image

Return to Web Design Section