CSS Basics
Why CSS selectors are needed?
Css selectors are ways to choose the elements
CSS Selectors are needed to shorten the code by not repeating the CSS code for different tags.
It also enhances the readability of the code.
Real World analogy :-

India is much more general and selecting it will apply changes to every citizens in India but on the other hand, when we talk about student Nand Kishore, it becomes very specific to whom we want to talk to.
Types of selectors :-
Id selector → A unique Id can be given to only one element. So for choosing one element it comes into picture. selected using a #.
class selector → When we want to give multiple elements the same style, then we give them the same class name. While applying css, we select those elements with the same class name and give them styling all at once. Selected using “.”
element selector → simply selects the element like h1, a and applies style to every element.
Group selector → It simply applies the same style to multiple elements all at once.
h1, h2{
color : saffron;
}
Descendent selector → It can help to select the child elements.
h1 p{
color : brown;
}
Ye sare ke sare h1 ke just andar ke paragraph tag ka text color brown kr dega.
Issi tarike se grandchildren ko bhi access kr skte h.
very important ! → Its priority is the highest. Overridung this is not possible.
