What is CSS
Css is the Casecading Style Sheet which helps to give style in Html or Php or Jquery web pages. Without css the website content or box or background and so on doesn’t view batter.
Types of CSS Selectors
There is 3 main css selector which help you to give style to a particular div
or tag
. The 3 selector of css are the following list.
1. Class Selector.
2. Id Selector.
3. Tag Selector.
You might be thinking what this three selector do. It is very easy to know it. i am going to explain you all of this thing. I will explain it to you with examples.
1. Class Selector
Class selector is mostly used for give one style to multiple tags where you want to give it. Css selector start with (.) I.e dot. If you want to style it, you have to put dot then give it name. It is most used selector. You can give class inside any tag by typing class. For example .
.gcolor{ background-color:green; }
2. Id Selector
It is use to give identity to a particular div or tag. The id of tag is only apply on one tag.it is identity of particular tag. It should be one id name to only one tag. Give another id name to other tag. It can apply to many inside many tag but some browser dosent support it. I recommend you give id once in one html tag.
#mycontainer{ background-color:green; }
3. Tag Selector
As you know tag is the html tag you may use it. For example. <b><i><p><u> etc.
It is called the tag. Tag selector select to the tags and give it style. It can select any html tag. The css tag selector is easy you just have to type the tag name and it give the style to it. For example .
Example.
b{ background-color:green; }