Table of contents
Css selectors are use to find the element whose property will be set css selectors are used to target html elements selectors make it easy for us to easily target single/multiple HTML elements in markup
there are 4 kind of selectors
- css element selector
- css id selector
- css class selector
- the css grouping selector
so there are way how to target each one of them
element selctor is simple where we can just hit the particular tag and add the instruction to it and it will change p{ color: red; }
id selector is one where we can target particular elemnets and can give command to it and we can do so by just declaring id= "id_name" it is unique
redElement {
color: red; }
class selector it is most used one and by which we can target multiple tags just by declaring them into a class we can also give two class and perform action on to it we target them by simple (.) and class will be called .navigation {
background_color: black; }
also ex
.navigation list_item{ align_item: center; color: blue; }
- grouping selectors helps us to select multiple tags in one line it self by just adding a (,) and we can declare the instruction accordingly
footer,span {background_color: pink; }