Skip to main content

CSS

What are Mobile-first and Desktop-first approaches?
A mobile-first approach to styling means that styles are applied first to mobile devices In mobile-first CSS, the following CSS rules are written first, and then changed in the media query (for desktop). This approach uses min-width media queries. min-width: 600px means // This applies from 600px onwards A desktop-first approach to styling means that styles are applied first to desktop devices In desktop-first CSS, the following CSS rules are written first, and then changed in the media query (for mobile devices). This approach uses max-width media queries. max-width: 600px // Thi
What are rem units? How to use them in CSS

rem units (short form of  root-em) dictate the font size of an item relative to the size of the root item. By default, most browsers use a fontsize of 16 pixels. So, if the root element is 16px, an element with the value 1rem will also equal 16px.

rem units reference the size of the root element

Rem vs. Em Units

rem units are relative to the root element, em is relative to the parent element.

Subscribe to CSS