Style Sheet Building Blocks

 

Constructing a style rule

Style sheets are just text files that contain rules. The style rules use properties and values to tell the elements how they will look.

Selector: the element you want to format

 

 

 

Comment your code, for you and for others

img{border: 4px solid red}/*Images will have an ugly sold red border*/

Those /*anything after that slash* is a comment-don't forget to close it*/

 

What happens when styles collide? The C in CSS


Inheritance, Specificity and Location

We'll come back to this later.