CSS

CSS Intro

CSS Intro Quiz

CSS Intro Exercise

CSS Basic

CSS Basic Quiz

CSS Basic Exercise

CSS Advance

CSS Advance Quiz

CSS Advance Exercise

CSS3

CSS3 Quiz

CSS3 Exercise

CSS Properties

CSS Functions

CSS Selectors

ID and Class CSS Selectors

ID Selector

 

 

id selectors allow you to style an HTML element that has an id attribute, regardless of its position in the document tree. To select an element with a specific id, use a hash character, and then follow it with the id of the element.

 

Syntax:-

 

Its syntax is:-

< style >

#element{

    property: value;

}

< /style >

 

CLASS Selector

 

Class selectors work in a similar way to ID selectors. Classes can be used as many as we want while ids can only be used once. To select elements with a specific class for styling purposes, use a dot character, followed by the name of the class.

 

Syntax:-

 

Its syntax is:-

< style >

.element{

    property: value;

}

< /style >

Code Explanation

All Tutorials related to CSS Basic

All Sections related to CSS