Convert pixel values to responsive and accessible rem units
Default browser root font-size is 16px
REM (Root EM) is a unit of measurement in CSS that is relative to the root element's font size (usually the HTML element).
1rem = root font-size (typically 16px)
Using REM units helps create scalable and accessible designs that adapt based on user preferences.
html {
font-size: 16px; /* Base size */
}
.title {
font-size: 2rem; /* 32px */
}
.text {
font-size: 1rem; /* 16px */
}
.small {
font-size: 0.75rem; /* 12px */
}Pro tip: Set your root font-size to 10px to make calculations even easier (1rem = 10px)
Subscribe to email updates and be the first to hear about our latest secret deals and exclusive offers.