Chạy thử Ví dụ Thuộc tính font-family trong CSS

Chạy thử Ví dụ Thuộc tính font-family trong CSS

Chạy thử Ví dụ Thuộc tính font-family trong CSS

Tự code rồi chạy thử... Chạy Thử
<!DOCTYPE html>
<html>
<head>
<title>Chạy thử Ví dụ Thuộc tính font-family trong CSS</title>
<link  media="all" href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
<style>
@charset "utf-8";
@font-face { font-family: OpenSansCondensed-Bold; src:url(https://webmoi.vn/media/css/fonts/OpenSansCondensed-Bold.ttf);
}
body{font-size:17px}
</style>
</head>
<body>
<h1>Chạy thử Ví dụ Thuộc tính font-family trong CSS</h1>

<p>Dùng để chọn font chữ mặc định của trình duyệt hoặc đặt tên cho font chữ nhúng từ file, ngoài ra còn có thể gọi tên font nhúng từ google, sau đó dùng để áp font chữ đã lấy lên văn bản của phần tử HTML:</p>

<!--Font nhúng từ file font-->
<p style="font-family: OpenSansCondensed-Bold;">font-family: OpenSansCondensed-Bold;</p>

<!--Font nhúng từ google-->
<p style="font-family: Roboto, sans-serif;">font-family: Roboto, sans-serif;</p>

<!--Font mặc định-->
<p style="font-family: Arial, Helvetica, sans-serif;">font-family: Arial, Helvetica, sans-serif;</p>

<p style="font-family: 'Times New Roman', Times, serif;">font-family: "Times New Roman", Times, serif;</p>

</body>
</html>
Chạy thử Ví dụ Thuộc tính font-family trong CSS nằm trong bài viết Thuộc tính font-family trong CSS