CSS Selectors
VIDYA ACADEMY
CSS selector are used to find (or select) the html element you want to style.
Types of selectors :-
- Id selector
- Class selector
- Universal selector
- Group selector
- Tag selector
- Combinatory selector
- Descendent slector (space)
- Child selector(>)
- Adjacent sibiling selector (+)
- General sibiling selector(~)
- Attribute selector
- CSS id selector :-
- CSS class selector :-
- CSS Universal selector :-
- CSS Grouping selector :-
The id slector uses the id attribute of an HTML element to select a specific element. The id of an element is uniquw within a page, so the id selector is used to select one unique element! To select an element with a specific id, write a hash (#)chaacter, followed by the id of the element.
Example :-
The class selector selets HTML element with a spefic class attribute. To select element with a specific class, write a period(.)character, followed by the class name.
Example :-
The universal selector (*) selects all HTML element on the page.
Example :-
The grouping selector selects all the HTML element with the same style definition. Look at the following css code (the h1, h2, and p element have the same style definitions).
Example :-
टिप्पणियाँ
एक टिप्पणी भेजें
thank you