Designers recommend using fonts sparingly, with just one or two typefaces per document.Just because you can add dozens of fonts to every page doesn’t mean you should. Handling font weights and styles in CSS.How to use your own web font files in CSS.Example: How to add the Open Sans font in CSS.How to use web fonts from a font repository.In this tutorial, we discuss various techniques and best practices for adding custom fonts to webpages. The availability of new open-source fonts also prevented legal issues from vendors who were reluctant to allow unrestricted use of commercial typefaces. However, it took more than a decade for cross-browser technology to be implemented by the tag. Reliable custom font use was only possible with image replacement or plugins such as Flash.īasic support for web fonts was introduced in Internet Explorer 4.0 released in 1997.
In the early days, designers were limited to popular system fonts such as Arial, Helvetica, Verdana, and Times New Roman. It may still contain information that is out of date. How to use web fonts in CSS: A tutorial with examplesĮditor’s note: This web fonts in CSS tutorial was last updated on 30 June 2021 to remove outdated information about browser support for variable fonts. Craig Buckler Follow Freelance UK IT consultant specializing in HTML5 webby stuff.