[CSS기초] 3. 서체의 종류

INDEX

  1. 요점
  2. Color
  3. Font-family
  4. 서채의 종류
  5. 웹 안전 서채
  6. font-size
  7. font-style
  8. font-weight
  9. font-variant
  10. line-height
  11. font

요점

Color

Font-family

body{
    font-family:"돋움";
}
body{
    font-family: "돋움", dotum, "굴림", gulim, arial, helvetica, sans-serif;
}

서채의 종류

웹 안전 서채

font-size

body{
    font-size : 14px;
}
h1{
    font-size : 2em; 
    /* 
    부모 요소(body)의 글씨크기 14px,
    14 * 2 = 28 이기 때문에
    h1의 글씨크기는 28px가 됩니다.
    */
}

font-style

p {
    font-style: italic;
}

font-weight

p {
    font-weight: bold;
    /* 또는 */
    font-weight: 700;
}

font-variant

p {
    font-variant : small-caps;
}

line-height

div{
    line-height: 1.6;
}

image

font

p {
    font-famliy : arial, helvetica, sans-serif;
    font-style : italic;
    font-size : 12px;
    line-height : 1.6;
    font-weight : bold;
    /* 위의 속성들을 아래와 같이 선언할 수 있습니다. */

    font: italic bold 12px/1.6 arial, helvetica, sans-serif;
}