본문 바로가기
WWWEB/CSS

html에 rem으로 작업 시

by 미니토이 2022. 6. 22.

브라우저 기본 글꼴 배율이 100%이고, 크기가 16px이기 때문에 16px을 기준으로 rem이 계산되는데,
브라우저 확대/축소 시 html에 고정값으로 인한 글꼴 크기 설정을 막음으로써 rem의 용도를 해침.

 

 

"Set the root HTML font-size as a percentage. That’s a percentage of the user’s default browser font-size. A typical method is to set the HTML font-size to 62.5%. That’s because 62.5% of 16px (typical default browser font-size) is 10px. That would still make 1.6rem = 16px. This now means that if the user’s default browser font-size is changed to, for example, 20px, 1.6rem would now equal 20px. So if your user wants bigger fonts, let them. Happy designer. Happy developer. All numbers are still easy to work with."

html root의 폰트 사이즈를 픽셀이 아닌 62.5%로 설정하여 사용하는 것이 일반적.

 

 

 

 

 

오늘도 하나 배운다 ㅋ

 

https://engageinteractive.co.uk/blog/em-vs-rem-vs-px

https://cafe.naver.com/hacosa/308539

 

 

 

728x90
반응형

댓글