Pages

Thursday 7 March 2013

CSS basics 2: Id & Class selectors

I touched upon the subject of Id and classes in my my last blog as they are the sector part of the Syntax. The style for each Id or Class is specified in the style tags which are in the head tags.

Id Selectors:
Id selctors change the style for one element. When defining the style for an Id the Id name will start with a "#". The Id name with the # is the selector which is followed by ordinary declorations. These declorations will set the style for the element with the Id selector.

Class Selectors:
class selectors can change the style for multuple elements. When defining a class name it will always start with a ".". Just like the Id the Class is the selector and is followed by declorations. These declorations will set the style for all the elements that are to have the class selector.to change the header (h1,h2,h3) or the paragraph (p) specificly the letters representing that elements are put before the dot.

This is a video I found it explains all:

No comments:

Post a Comment