CSS Mastery Notes

Type Selectors

p {color: black;}
a{text-decoration: Underline;}
h1{font-weight:bold;}

Descendant Selectors (Applies to all descendants of the element)

li a {text-decoration: none;} 

ID Selectors

#intro {font-weight: bold;}

Class Selectors

.dateposted {color: green;}

Pseudo-classes

a:link {color:blue;}
a:hover {color:red;}

Dynamic Pseudo-classes - Supported in Modern Browsers Only -No IE 6

/* makes table rows red when hovering*/

tr:hover{background-color: red;}
.
.
.
.
/* makes form inputs yellow when focused*/

input:focus {background-color: yellow;} 

Universal Selector

/* Styles Every Element on the Page*/
* {
	padding: 0;
	margin: 0;
  }

Child Selector (Applies to only descendants immediately following the Element)

/* Styles Child Descendant*
ul#nav > li 
 {
 list-style-type: square;
color:#990000 }

Attribute Selectors

abbr[title] {border-bottom: 1px dotted #999;} 
abbr[title]:hover {cursor:help;}

CSS