Inheritance in CSS
Inheritance is how certain values in an element are passed down to child elements.
It helps by keeping the styling consistent with the design of the website.
Properties like "color", "font-size", and "line-height" keep inheritance. Some like "margin", "padding", and "border" do not keep inheritance.
Specificity in CSS
Specifity is what browsers use to give more priority to certain css selectors. Each selector has a certain specificity.
For example, inline styles and ID selectors have the highest specificity. While type selectors and class selectors are the lowest.
ID and Class Attributes
ID and Class attributes help identify elements in our websites. However, ID attributes have a higher specificity than Class attributes.
They shoud only be used for very specific elements. Usually ones that only appear once on a page. While class attributes are used for multiple elements with the same style.