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

CSS Part-2

The document discusses different types of CSS selectors including element, ID, class and grouping selectors. Element selectors select elements by name, ID selectors select by element ID, and class selectors select by class. Grouping selectors allow selecting multiple elements or all elements on a page with the same styles.

Uploaded by

Subhankar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

CSS Part-2

The document discusses different types of CSS selectors including element, ID, class and grouping selectors. Element selectors select elements by name, ID selectors select by element ID, and class selectors select by class. Grouping selectors allow selecting multiple elements or all elements on a page with the same styles.

Uploaded by

Subhankar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

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