class Selector

  • Styles a group of elements
  • Utilises the class attribute of an element
  • Defined with a¬†.¬†followed by the value assigned to the class attribute

 

Save & refresh browser:

A very simple page

A line of text.

 

A line of text.

 

A line of text.

 

A line of text.

 

A line of text.

 

 

More specific elements can also styled by specifying only parent elements with the class defined. In this example only <p> elements have the rule applied:

Save & refresh browser:

A very simple page

A line of text.

 

A line of text.

 

A line of text.

 

A line of text.

 

A line of text.

Leave a Reply