티스토리 뷰

개발

em vs rem

개발자와코더사이가 PM일까? 2020. 7. 29. 20:58
반응형

* rem은 페이지 최상위 요소(root) => html 요소의 폰트 크기가 기준, 아무것도 설정 하지 않았으면 기본값은 16px

예시) 폰트 크기가 16px이면 10rem이면 160px

* em은 스타일을 지정한 요소의 폰트 크기를 곱한 값

예시) div 폰트 크기가 18px이면 10em이면 180em

참고) 평균적으로 em은 계산하기 힘들기때문에 rem만 쓰는 경우가 있다고 한다.

* rem 계산기 사이트

** px를 rem으로 계산하는 사이트

https://offroadcode.com/rem-calculator/

 

REM Calculator | Umbraco Registered Partner - Offroadcode Limited

We design and build Umbraco websites - Find out who we are and how we work

offroadcode.com

** px<->rem으로 계산하는 사이트 

http://pxtoem.com/

 

PXtoEM.com: PX to EM conversion made simple.

What is an EM? Wikipedia puts it well: "An em is a unit of measurement in the field of typography, equal to the size of the current font." If your font-size is at 16 pixels, then 1em = 16px For more information visit Wikipedia and Mozilla MDN. What is the

pxtoem.com

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함