Answers for "pixel to rem conversion"

CSS
0

pixel to rem conversion

html {
  /* 62.5% of 16px base font size is 10px */
  font-size: 62.5%;
}

/* Preserve 16px body font-size, set body font-size to 1.6rem */
body {
  /* 16px */
  font-size: 1.6rem;
}

.some-element {
  /* 10 * 1.2 = 12px */
  font-size: 1.2rem;
}
Posted by: Guest on September-22-2021

Browse Popular Code Answers by Language