0% found this document useful (0 votes)
3 views

CSS 2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

CSS 2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

venkatesh.mansani@yahoo.

com Naresh i Technologies

Simple & grouping


SelectorS
Simple Selectors:
1) CSS Element Selector
=> It selects the html elements based on the element name.
Example:
h1 { color: red; }
=> Here all h1 elements are displayed with red color.
2) CSS Id Selector
=> It selects the value of id attribute in html tag.
Example:
#first { color: red; }
=> It is applied to html element with id="first".
3) CSS Class Selector
=> It selects the value of class attribute in html tag.
Example:
.demo { color: red; }
=> It is applied to html element with class="demo".
It is also possible to apply to specific element.

Java By Venkatesh Mansani [email protected]


[email protected] Naresh i Technologies

Example:
h1.demo { color: red; }
=> It is applied to h1 element with class="demo" only.
Html element can refer more than one class also.
Example:
<h1 class="demo test">

Grouping Selectors:
1) Grouping Multiple Elements Selector
=> It selects the more than one html elments with the same style
defintion.
Example:
h1, h2 { color: red; }
2) Grouping All Elements Selector
=> It selects all html elements. It is also called as Universal Selector.
Example:
* { color: red; }

By

Mr. Venkatesh Mansani


Naresh i Technologies
Java By Venkatesh Mansani [email protected]

You might also like