Jul 20, 2007

Add a background color to a heading

Apply to h-tag

Example

h1 {
background-color: #ADD8E6;
color: #256579;
font: 18px Verdana, Geneva, Arial, Helvetica, sans-serif;
padding: 2px;
}

Create a link that changes color on mouseover

Apply for a-tag

Example.

a:link, a:visited, a:hover, a:active {
text-decoration: underline;
color: #6A5ACD;
background-color: transparent;
}

Remove underlines from any link

Apply for a-tag

a:link, a:visited {
text-decoration: none;
}

Use pixels, points, ems for font sizes

Apply for any selector.

Example.

p {
font-size: 10pt;
}

p {
font-size: 12px;
}

p {
font-size: 1em;
}

p {
font-size: 100%;
}

p {
font-size: small;
}

Replace font tags with CSS

Apply for any selector.

Example.
p {
color: #800080;
font-family: Verdana,Geneva,Arial,Helvetica,sans-serif;
}