CSS - Cascading Style Sheet is used to beautify Web pages and there are some common things which are very basic yet conceptual and very important for development.
So here are some of the important tips about CSS,
- Class vs ID : Class is denoted by starting with dot ( '.' ) and ID by ( '#' ) in JS . Main Difference between these two is - Class is a reusable property and used for design purposes.While Idwhile Id is to be used only once, mainly It is used as a unique identifier for any html elemnet.
- !important : This is used when you want to overrite a style's property. !important has the most priority. It is advisable to not to use it.
- em vs px : em is a scalable unit which referes to the current font size as an unit, px is a fixed size measurement unit.
- calc() : Use this function for viewport size related classes.
- reset.css : It resets all fundamental styles.
- Position : absolute position refers to an elements position according to the object that is within which has been given the style relative.