반응형
CSS는 문자의 스타일들을 정의하는 몇몇 옵션이 있다.
이러한 옵션들은 <font>태그를 완전히 치환할수 있고 그 이상도 가능하다.
CSS는 당신의 평범한 HTML 을 더 많이 강력한 스타일 정의를 가능하게 한다.
Font 속성들
속성 | 값들 | NS | IE | 예제 |
font-family | font name generic font |
4+ 4+ |
4+ 4+ |
font-family:arial font-family:arial, helvetica |
font-style | normal italic oblique |
4+ 4+ |
4+ 4+ 4+ |
font-style:normal font-style:italic font-style:oblique |
font-variant | normal small-caps |
4+ 4+ |
font-variant:normal font-variant:small-caps | |
font-weight | normal bold bolder lighter 100-900 |
4+ 4+ 4W 4W 4+ |
4+ 4+ 4+ 4+ 4+ |
font-weight:normal font-weight:bold font-weight:bolder font-weight:lighter font-weight:250 |
font-size | normal length length absolute absolute absolute absolute absolute absolute absolute relative relative percentage |
4+ 4+ 4+ 4+ 4+ 4+ 4+ 4+ 4+ 4+ 4+ 4+ 4+ |
4+ 4+ 4+ 4+ 4+ 4+ 4+ 4+ 4+ 4+ 4+ 4+ 4+ |
font-size:normal font-size:14px font-size:14pt font-size:xx-small font-size:x-small font-size:small font-size:medium font-size:large font-size:x-large font-size:xx-large font-size:smaller font-size:larger font-size:75% |
4+ : 4 버전 이상 , 4P : 문제가 있음, 4M : Mac 만 가능, 4W : 윈도우즈만 가능
모든 폰트 속성을 한번에 지정하기
전형적인 폰트정의 예 :
B {font-family:arial, helvetica; font-size:12px; font-weight:bold;} |
그러나 모든 폰트 속성들은 실제 font 속성으로 표현할 수 있다.
B {font:arial, helvetica 12px bold} |
짧게 쓰는 경우는 모든 스타일을 동일할 때를 제외하고 사용하지 않는 것이 좋다.
실제로 명시적으로 작성한 경우가 더 알기 쉽고 수정할 때도 용이하다
TEXT 속성들
속성 | 값들 | NS | IE | 예제 |
line-height | normal number length percentage |
4W 4+ 4+ 4+ |
4+ 4P 4+ 4P |
line-height:normal line-height:1.5 line-height:22px line-height:150% |
text-decoration | none underline overline line-through blink |
4+ 4+ 4+ 4+ |
4M 4+ 4W 4+ |
text-decoration:none text-decoration:underline text-decoration:overline text-decoration:line-through text-decoration:blink |
text-transform | none capitalize uppercase lowercase |
4+ 4+ 4+ 4+ |
4W 4W 4W 4W |
text-transform:none text-transform:capitalize text-transform:uppercase text-transform:lowercase |
text-align | left right center justify |
4+ 4+ 4+ 4+ |
4+ 4+ 4+ 4W |
text-align:left text-align:right text-align:center text-align:justify |
text-indent | length percentage |
4+ 4+ |
4+ 4+ |
text-indent:20px; text-indent:10% |
white-space | normal pre |
4+ 4+ |
white-space:normal white-space:pre |
4+ : 4 버전 이상 , 4P : 문제가 있음, 4M : Mac 만 가능, 4W : 윈도우즈만 가능
만약 FONT에 색을 추가하고 싶으면 다음과 같은 방법으로 사용한다.
B {font:arial, helvetica 12px bold; color:red} |
CSS Color 속성들
CSS는 페이지들에 대해 텍스트와 뒷배경 영역의 색을 지정하는 몇몇 옵션이 있다.
이러한 옵션들은 단순한 HTML 안에 전체 Color 속성들을 변경 가능하다.
예를들면, 단순한 HTML 안에, 테이블을 포함한 영역에 특별한 색을 강제로 표시할때 당신은 테이블 영역에 정의없이 사용할 수 있다.
테이블의 각각 셀들, <TD> 태그들 안에 class를 통해 쉽게 사용가능하다.
Color 속성들
Property | Values | NS | IE |
color | <color> | 4+ | 4+ |
background-color | transparent <color> |
4+ 4+ |
4+ 4+ |
background-image | none url(<URL>) |
4+ 4+ |
4+ 4+ |
background-repeat | repeat repeat-x repeat-y no-repeat |
4+ 4+ 4+ 4+ |
4+ 4+ 4+ 4+ |
background-attachment | scroll fixed |
4+ 4+ | |
background-position | <percentage> <length> top center bottom left right |
4+ 4+ 4+ 4+ 4+ 4+ 4+ | |
background | <background-color> <background-image> <background-repeat> <background-attachment> <background-position> |
4+ 4+ 4+ |
4+ 4+ 4+ 4+ 4+ |
4+ : 4 버전 이상 , 4P : 문제가 있음, 4M : Mac 만 가능, 4W : 윈도우즈만 가능
반응형