The complete CSS tutorial for beginners- part 2


Friends..again we came with the tutorial about CSS. This is the 2nd part of this tutorial. On this part we will disclose about class selector & ID selector. You can also catch the 1st part of this tutorial here.

Class selector

Class selector is one of the technique to specify any part or one or more components of web page of CSS. Multiple items can be identified by one class Selector, that’s how it helps to reduce the amount of coding.
Like- CSS code for <p class="mar"> 24 / 7 Support</p> is-
.mar{color: #C03;
font-size:36px}
Here class key-word is used in HTML tag to point out class selector. Then it needs putting a “=”sign there & enclosing the class name in double quotes. Like- <p class="mar">. Here “mar” is the class name. Dot sign (.) is used to point out class on style sheet.
Next we are going to discuss about ID selector.

ID selector:

ID selector is a popular way of CSS to specify any part or or content of a web page. But you cannot identify multiple contents by a single ID selector like class selector.
Like- <p id="post1"> We are bangladeshi Hostgator hosting provider. The world wide technical and support team is working for your best movement.  information. 
Like- CSS code for </p> is-
#post1{color:#066;
font-family:Tahoma;
text-align:justify;}
ID key-word is used to indicate on HTML tag. Then it needs putting a “=”sign there & enclosing the class name in double quotes. Like- <p id="post1">. Here the ID name is post1. (#) sign is used to point out ID on style sheet.
Thank you all.

Click to Add a New Comment

Post a Comment