CSS ID Selectors

In an HTML document, CSS ID selectors match an element based on the contents of that element's  attribute, which must match exactly the value given in the selector. The selector is written by first using the node name of the element, followed by a hash sign, then the name of the. No white spaces are allowed between those three elements. For example, a  with an   of   would be written as. The selector may also be written to identify only an, not an   which matches the correct element. Example:.

Example:

Title  span#blue { background-color:blue; }            span { background-color:red; }            #green { background-color:green; }

p#1 { background-color:transparent; }     This text has a blue bg. This one has a red one. This one has a green one. This has a transparent bg.