Which CSS units are considered to be relative units that allow for responsive designs?
- em, rem
- in, mm
- pt, pc
- px, cm
em and rem are relative units in CSS, enabling responsive design. Unlike absolute units like px, em and rem adapt to the font size of the parent or root element, respectively. This flexibility makes them valuable for creating layouts that adjust to different screen sizes and user preferences.
Loading...
Related Quiz
- What is the purpose of using the 'lang' attribute in HTML in the context of internationalization?
- How can you create a function in SASS that returns a value?
- You're creating a magazine-style layout with text flowing into multiple columns. As the viewport width increases, you want to add more columns while ensuring that each column does not exceed 250px in width. Which CSS properties would you adjust?
- You have an element inside a container. The container has a font-size of 20px. If you set the child element's font-size to 1.5em, what will be its computed font-size?
- A developer wants a sidebar to be fixed on the desktop but static on mobile devices. Which CSS properties and values will they need to adjust using media queries?