9. CSS Id Selector

An id selector is the XHTML element with a matching id attribute that is to be given style or layout properties. An id selector is defined in CSS using the "#" sign followed by the value of the id attribute (no space between the "#" and the value of the id). An id attribute value is required to be unique; no two id's within an XHTML document may be the same.

Example 9.1 Id Selector Usage
<html xmlns="http://www.w3.org/1999/xhtml">
    <title>Element selector</title>
    <style type="text/css">
    #test {
    <div id="test">Styled by an id selector.</div>

In the above example an element with an id attribute with a value of test will be given style or layout properties.