css 원하는 글꼴 사용하기

· 8년 전 · 1843
css 원하는 글꼴 사용하기
CSS3 @font-face규칙에서 먼저 글꼴 이름 (예 : myFirstFont)을 정의한 다음 글꼴 파일을 가리켜 야합니다.

팁 : 항상 글꼴 URL에 소문자를 사용하십시오. 대문자는 IE에서 예기치 않은 결과를 줄 수 있습니다.

HTML 요소에 글꼴을 사용하려면 다음 font-family속성을 통해 글꼴 이름 (myFirstFont)을 참조하십시오 .


@font-face {
font-family: myFirstFont;
src: url(sansation_light.woff);
}

div {
font-family: myFirstFont;
}



<!DOCTYPE html>
<html>
<head>
<style>
@font-face {
font-family: myFirstFont;
src: url(sansation_light.woff);
}

div {
font-family: myFirstFont;
}
</style>
</head>
<body>

<div>
With CSS3, websites can finally use fonts other than the pre-selected "web-safe" fonts.
</div>

<p><b>Note:</b> Internet Explorer 8 and earlier, do not support the @font-face rule.</p>

</body>
</html>
|

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기
🐛 버그신고