CSS font-family 속성은 선택한 요소의 특정 글꼴을 설정하는 데 사용됩니다. 브라우저 간 호환성을 보장하기 위해 추가 글꼴을 지정하여 웹 안전 글꼴을 사용하는 것이 좋습니다.
구문
CSS font-family 속성의 구문은 다음과 같습니다. &mins;
Selector {
font-family: /*value*/
} 다음 예는 CSS font-family 속성을 보여줍니다 -
예시
<!DOCTYPE html>
<html>
<head>
<style>
h2 {
background-color: thistle;
font-family: "Magneto", Arial;
}
p {
font-family: "Segoe Print", serif;
font-size: 1.4em;
}
</style>
</head>
<body>
<h2>Learn Fortran</h2>
<p>Fortran, as derived from Formula Translating System, is a general-purpose, imperative programming language. It is used for numeric and scientific computing.</p>
</body>
</html> 출력
이것은 다음과 같은 출력을 제공합니다 -

예시
<!DOCTYPE html>
<html>
<head>
<style>
th {
font-family: "Franklin Gothic Book", Arial;
border: thin solid blue;
}
td {
font-family: "Lucida Console", serif;
font-size: 1.1em;
box-shadow: inset 0 0 3px black;
}
caption {
font-family: Broadway;
font-size: 24px;
}
</style>
</head>
<body>
<table>
<caption>Demo Table</caption>
<tr>
<th>DEMO 1</th>
<th>DEMO 2</th>
</tr>
<tr>
<td>demo a</td>
<td>demo b</td>
</tr>
<tr>
<td>demo c</td>
<td>demo d</td>
</tr>
</table>
</body>
</html> 출력
이것은 다음과 같은 출력을 제공합니다 -
