CSS의 절대단위와 상대단위     -막간학습-

 

 절대단위:

-규격이 정해져 있는 단위.

-각 단위들끼리 값 변환이 가능.

-pt 는 문자의 크기 지정할 때 많이 쓰인다.

-기본 시스템 폰트 크기는 12pt.

 

cm : 센티미터.

mm : 밀리미터.

in(인치) : 1in2.54cm

pt(포인트) : 1pt  1/72 in. 문자 크기 지정할 때 사용.

pc(파이커) : 1pc  12 pt.

 

상대단위:

-상대단위가 많이 쓰이는 이유는 다양한 플랫폼들이 등장했기 때문.

-태블릿 pc, 스마트 폰 등 여러가지 시스템에 유동적으로 적용하기 위해서는 상대단위가 필수적이다.

 

px(픽셀) : 해상도에 따라 달라짐. pt대신 많이 사용됨.

% 브라우저 기본 글꼴 크기를 100%로 하고 상대적 크기를 나타냄.

em 브라우저 기본 글꼴 크기를 1em으로 하고 상대적 크기를 나타냄.

ex 소문자 x 의 높이를 1로 한다.

 

기본 브라우저 폰트의 크기는 1em  100% 로 한다.

현재 해상도에서 글자의 기본크기는 16px 이다.

16px = 1em = 100% 가 된다.

 ex  16px 일 때 소문자 x 의 높이 값입니다

해상도가 높아지면 글자도 더 커진다.


Posted by star story :

Snippet :: Code View :: "+location.href+'
'+b+"

");top.consoleRef.document.close()}$(".snippet-container").each(function(b){$(this).find("a.snippet-text").click(function(){var d=$(this).parents(".snippet-wrap").find(".snippet-formatted");var c=$(this).parents(".snippet-wrap").find(".snippet-textonly");d.toggle();c.toggle();if(c.is(":visible")){$(this).html("html")}else{$(this).html("text")}return false});$(this).find("a.snippet-window").click(function(){var c=$(this).parents(".snippet-wrap").find(".snippet-textonly").html();a(c);$(this).blur();return false})});$(".snippet-toggle").each(function(b){$(this).click(function(){$(this).parents(".snippet-container").find(".snippet-wrap").toggle()})})});