Anatomy of a Style Declaration

Delicious Bookmark this on Delicious

style declaration

 

A Style Declaration consists of:

  • 1.  Selector:  the selector is used to 'select' the HTML element that you want to style.
  • 2.  Declaration Block:  is everything between the curly brackets.

The Declaration Block is further broken down into:

  • 1.  CSS Property 
  • 2.  Value

For instance, the Style Declaration (Style) in the image above means all paragraphs will have a font-size of 14px.

The letter 'p' is a Tag or Element Selector.  This type of Selector simply selects an HTML tag by indicating the letters of the HTML tag. 

For instance, the paragraph tag is written as such:  <p></p>

 

Therefore, we just use the letter 'p' to select 'paragraphs'.

 

Next, Learn About CSS Selectors   next