An Interest In:
Web News this Week
- April 2, 2024
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
July 25, 2022 11:28 am GMT
Original Link: https://dev.to/itskunal/css-selectors-2kjj
CSS Selectors.
CSS selectors, these are used to select a particular or group of tags sharing some common thing like class name, id, (siblings), tag name.
Selectors follow specificity (say priority), for example if there is a tag having class = a
and id = b
. If you're selecting a element with a
and b
then CSS property given to b
are applied.
You can read more about css selectors here.
Basic Selector
Universal Selector
selects all the elements, denoted by *
.
Type Selector
This selector selects all elements with same tag name. tag_name
.
Class Selector
This selector selects all elements with class name that is selected.class_name
.
ID Selector
This selector selects element with a id.
many elements can have one id, but use class for this, it's just convention.id_name
.
Original Link: https://dev.to/itskunal/css-selectors-2kjj
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To