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

CSS Selectors

CSS selectors are used to style HTML elements and are divided into five categories including simple selectors based on name, id and class, pseudo selectors for special states, universal selectors for all elements, id selectors using the id attribute, and class selectors using the class attribute. Pseudo-selectors are used to style elements in certain states like hover or focus.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

CSS Selectors

CSS selectors are used to style HTML elements and are divided into five categories including simple selectors based on name, id and class, pseudo selectors for special states, universal selectors for all elements, id selectors using the id attribute, and class selectors using the class attribute. Pseudo-selectors are used to style elements in certain states like hover or focus.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

CSS

CSS selectors are used to "find" (or select) the HTML elements you want to
style.

We can divide CSS selectors into five categories:

 Simple selectors (select elements based on name, id, class

 Pseudo selector (A pseudo-class is used to define a special state of an


element)
 Universal Selector (The universal selector (*) selects all HTML elements
on the page.

 The CSS id Selector


 The id selector uses the id attribute of an HTML element to select a
specific element.

The CSS class Selector


The class selector selects HTML elements with a specific class attribute.

Pseudo-Selector
A pseudo-class is used to define a special state of an element.

It can be used to:

 Style an element when a user mouses over it


 Style visited and unvisited links differently
 Style an element when it gets focus.

The CSS Universal Selector


The universal selector (*) selects all HTML elements on the page.

You might also like