E.classname.classname

Matches the element E with the class attribute "classname" and the class attribute "classname".

HTML:

  1. <p class="red">Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
  2. <p class="blue">Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
  3. <p class="red blue">Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>

CSS:

  1. p.red{color:red}
  2. p.blue{color:blue}
  3. p.red.blue{color:purple}

Output:

Lorem ipsum dolor sit amet, consectetur adipisicing elit.

Lorem ipsum dolor sit amet, consectetur adipisicing elit.

Lorem ipsum dolor sit amet, consectetur adipisicing elit.

In the example, the first paragraph should be red, the second blue and the third purple.