CSS: / Home / IDSelector

The ID Selector

  <head>
    <title>The Style Element</title>
    <meta charset="utf-8" />
    <style>
      #pageTitle {
        background: lightsteelblue;
      }
    </style>
  </head>

An ID name should only be assigned to one element in a document. So if an element has an ID of "pageTitle"; that ID name should not be used as an ID name anywhere else in the document.

An ID selector defines the single element to which the style properties are applied.

Using the above "#pageTitle" rule example; only the element that is qualified with the attribute (id="pageTitle") will use the #pageTitle ID style properties.

<- ClassSelector            ExternalCSS ->
6IDSelector