Webmaster - Fonts in web pages
On March 22,2022 by Tom RoutleyWhen you use a font in a web page, it will only be displayed if the users has the same font installed on their computer.
You have no way to force the user to download and install a specific font.
You can't be sure that the fonts are installed on the user's computer.
You can't be sure of how your page will be rendered in the browsers.
Using alternative fonts
For example, if you want your page to display the "Trebuchet MS" font . Then specify:
font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
By putting "Trebuchet MS" first, you specifiy that the page is to be displayed using this font.
If the user has font installed , then the page will be displayed with Trebuchet MS.
If the user does not have this font, the browser will try successively with each following ones (Verdana, Arial ...).
Simply specify fonts that are graphically/visually close to the font you want to use.
The default types
There are 3 kinds of default fonts that all browsers recognize:
serif:
sans-serif
monospace
When you specify the font to be used, it is good practice to always specify one of these three generic fonts as a last resort.
Typically, as in our above example:
font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
Sans-serif is the font that will be closest to "Trebuchet MS" and in the worst case you will have a website that looks slightly different from your original concept.
The appearance of the default fonts
Each operating system and browser interprets the default fonts differently
serif: It's "Times New Roman" under Windows, and the "Times" on the Macintosh (which is different from Windows).
sans-serif: This is the "Arial" in Windows, and the "Helvetica" on Macintosh.
monospace: "Courier New" in Windows, "Courrier" on the Macintosh, and often "VeraSans" or "DejaVuSans" Linux.
Here the appearance of the fonts under Windows (in Internet Explorer):
Under Windows, but with ClearType enabled:
MacOS X (Safari):
Linux (Ubuntu - Firefox):
Recommendations
For serif fonts, specify:
"Times New Roman", Times, serif;
For sans-serif fonts, specify:
Verdana, Arial, Helvetica, sans-serif;
(Verdana has a better screen readability that Arial, even though there is controversy over the use of the police).
For monospaced fonts:
"DejaVu Sans Mono", "Bitstream Vera Sans Mono", monospace;
Vera and DejaVu font families are Open source and allows the best readability.
The fonts available upon installation of Windows XP.
Article Recommendations
Latest articles
Popular Articles
Archives
- November 2024
- October 2024
- September 2024
- August 2024
- July 2024
- June 2024
- May 2024
- April 2024
- March 2024
- February 2024
- January 2024
- December 2023
- November 2023
- October 2023
- September 2023
- August 2023
- July 2023
- June 2023
- May 2023
- April 2023
- March 2023
- February 2023
- January 2023
- December 2022
- November 2022
- October 2022
- September 2022
- August 2022
- July 2022
- June 2022
- May 2022
- April 2022
- March 2022
- February 2022
- January 2022
- December 2021
- November 2021
- October 2021
- September 2021
- August 2021
- July 2021
- January 2021
Leave a Reply