본문 바로가기

잡/공부일기

CSS Units 정리

절대적 값 ex) px

 

상대적 값 ex) em, ex, ch, rem, vh

 

em, rem, vw, vh, %를 주로 씀

 

em : 부모의 fontsize에 상대값을 가짐

rem : root에 지정된 font-size에 따라 달라짐 (html을 따라감)

 

vw,vh : 브라우저를 따라감

 

부모 따라서 바뀜 : %, em

브라우저에 따라서 바뀜 : vm,vh,rem

BOX : %, vm,vh

font-size : em,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

 

반응형

' > 공부일기' 카테고리의 다른 글

요즘 후기  (0) 2022.09.27
22년2월14일~2월20일 공부기록  (0) 2022.02.13
2번째 주 공부 회고  (0) 2022.02.13
1번째 주 공부 회고  (0) 2022.02.05
02월05일 자바스크립트 중급 3  (0) 2022.02.05