W3.CSS Fonts - W3Schools
Có thể bạn quan tâm
Verdana is the default font used in W3.CSS. Verdana has a good letter spacing, and is easy to read. Verdana is also the default font for W3Schools.
Segoe UI is the default font for headings. Segoe UI has a more narrow letter spacing. This allows for a few more letters in the headings.
Using Another Default Font
Using another default font in W3.CSS is very easy:
Example
body, h1, h2, h3, h4, h5, h6 { font-family: Arial, Helvetica, sans-serif; } Try It Yourself »Using Font Classes
With W3.CSS you can use 4 different built-in font classes:
- w3-serif
- w3-sans-serif
- w3-monospace
- w3-cursive
This is w3-serif
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Example
<p class="w3-serif"> Try It Yourself »This is w3-sans-serif
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Example
<p class="w3-sans-serif"> Try It Yourself »This is w3-monospace
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Example
<div class="w3-monospace"> Try It Yourself »This is w3-cursive
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Example
<div class="w3-cursive"> Try It Yourself »Web Safe Sans Serif Fonts
Font Family | Safe Fallback |
---|---|
Arial | Helvetica, sans-serif |
Helvetica | Arial, sans-serif |
Verdana | Geneva, sans-serif |
Geneva | Verdana, sans-serif |
Tahoma | Arial, sans-serif |
Trebuchet MS | Arial, sans-serif |
Arial is considered the safest sans-serif font on the web. It is installed on all Windows machines (99.8%) and all Mac machines (98.7%).
Helvetica is the preferred fallback because the two fonts are almost identical. Helvetica runs on all Mac machines (100%) but on fewer Windows machines (7.3%).
Using Arial with Helvetica fallback, or Helvetiva with Arial fallback, covers both worlds.
Verdana is also considered to be a web safe sans-serif font. It runs on all Windows machines (99.8%), and all Mac Machines (99.1%).
Geneva is Verdanas preferred fallback, because the two fonts are quite similar, and Geneva runs on all Mac machines (99.6%).
Tahoma was the standard font in Windows 95. It works on 99.9% of all Windows machines, and 91.7% of all Mac machines.
Trebuchet MS has been released with all Windows operating systems (99.7%) since Microsoft Windows 2000. It is also included on Macs machines (97.1%), iOS and Chrome OS.
Source: CSS Font Stack
This is Arial
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Example
<style> body, h1, h2, h3, h4, h5, h6 { font-family: Arial, Helvetica, sans-serif; } </style> Try It Yourself »Arial is ranked #1 in use on the Web.
This is Helvetica
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Example
<style> body, h1, h2, h3, h4, h5, h6 { font-family: Helvetica, Arial, sans-serif; } </style> Try It Yourself »Helvetica is ranked #2 in use on the Web.
This is Verdana
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Example
body, h1, h2, h3, h4, h5, h6 { font-family: Verdana, Geneva, sans-serif; } Try It Yourself »Verdana is ranked #3 in use on the Web.
This is Geneva
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Example
body, h1, h2, h3, h4, h5, h6 { font-family: Geneva, Verdana, sans-serif; } Try It Yourself »This is Tahoma
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Example
body, h1, h2, h3, h4, h5, h6 { font-family: Tahoma, "Trebuchet MS", sans-serif; } Try It Yourself »This is Trebuchet MS
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Example
body, h1, h2, h3, h4, h5, h6 { font-family: "Trebuchet MS", Tahoma, sans-serif; } Try It Yourself »This is Segoe UI
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.Example
body, h1, h2, h3, h4, h5, h6 { font-family: "Segoe UI", Arial, sans-serif } Try It Yourself »Segoe UI is the default font in Windows 10. It is also the default heading font in W3Schools an W3.CSS.
Web Safe Serif Fonts
Font Family | Safe Fallback |
---|---|
Times New Roman | Times, serif |
Georgia | serif |
Times New Roman is considered the most web safe serif font. It works on all Windows machines (99.7%) and all Mac machines (97.4%).
Some older operating systems might have an alternative version called Times, so it is smart to use Times as a fallback as well as serif.
Georgia is also considered very safe. It is a little larger than Times New Roman, but works well on most Windows machines (99.4%) and Mac machines (97.5%).
To be on the safe side, use serif as fallback.
This is Times New Roman
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Example
body, h1, h2, h3, h4, h5, h6 { font-family: "Times New Roman", Times, serif; } Try It Yourself »This is Georgia
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Example
body, h1, h2, h3, h4, h5, h6 { font-family: Georgia, serif; } Try It Yourself »Monospace Fonts
In a monospace font, all letters occupy the same width.
Monospaced fonts are often used to display computer code.
Font Family | Safe Fallback |
---|---|
Courier New | monospace |
Lucida Console | Monaco, monospace |
Monaco | Lucida Console, monospace |
Courier New is considered the most web safe monospace font. It is installed on most Windows and Mac machines.
Lucida Console does not run on Mac. Monaco does not run on Windows.
One solution is to use Monaco as fallback for Lucida Console.
There are no 100% web safe fonts, but you can always use w3-monospace.
This is w3-monospace
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Example
<div class="w3-monospace"> Try It Yourself »This is Courier New
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Example
body, h1, h2, h3, h4, h5, h6 { font-family: "Courier New", monospace; } Try It Yourself »This is Lucida or Monaco
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Example
body, h1, h2, h3, h4, h5, h6 { font-family: "Lucida Console", Monaco, monospace; } Try It Yourself » Handwriting FontsThere are no web safe handwriting fonts, but you can safely use w3-cursive.
This is w3-cursive
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Norway has a total area of 385,252 square kilometers and a population of 5,438,657 (December 2020). Norway is bordered by Sweden, Finland and Russia to the north-east, and the Skagerrak to the south, with Denmark on the other side.
Example
<div class="w3-cursive"> Try It Yourself » ❮ Previous Next ❯ ★ +1 Track your progress - it's free! Log in Sign UpTừ khóa » Font Chữ Css
-
Các Thuộc Tính định Dạng FONT CHỮ Trong CSS - Web Cơ Bản
-
Bài 13: Phông Chữ Trong CSS (CSS Fonts) | Tìm ở đây
-
Thuộc Tính Font-size Font-style Font-weight Font-variant
-
Học CSS - Trang Trí Font Chữ Cho Văn Bản - Thạch Phạm
-
Thuộc Tính Font | CSS | Học Web Chuẩn
-
CSS: Fonts
-
Tổng Hợp Một Số Font Css đẹp Cho Thiết Kế Web - Gists · GitHub
-
Font Trong CSS - Comdy
-
Phông Chữ CSS - CodeHub
-
Gợi ý 10 Font Chữ Cho Website đẹp Nhất 2021 & Lưu ý Khi Chọn
-
Font-family - CSS: Cascading Style Sheets | MDN - Mozilla
-
Sử Dụng Font Trong CSS | Lê Vũ Nguyên Dạy Học Lập Trình
-
Các Thuộc Tính Tác động Vào Font Chữ Trong CSS