Get the App
SLTechnology News&Howtos  ›  Development  › 

How to set fonts embedded in HTML documents

Shulou Source: shulou.com Published: 2022-06-01 07:25:34 10月03日 Update

This article mainly introduces "how to set the font embedded in HTML documents". In daily operation, I believe many people have doubts about how to set the font embedded in HTML documents. Xiaobian consulted all kinds of materials and sorted out simple and easy operation methods. I hope to answer your doubts about "how to set the font embedded in HTML documents"! Next, please follow the small series to learn together!

Set font (compatible with all browsers)

@font-face {font-family: 'iconfont';src: url("fonts/iconfont/iconfont.eot");src: url("fonts/iconfont/iconfont.eot?# iefix") format("embedded-opentype"), url("fonts/iconfont/iconfont.ttf") format("truetype"), url("fonts/iconfont/iconfont.woff") format("woff"),url("fonts/iconfont/iconfont.svg#icomoon") format("svg");font-weight: normal;font-style: normal; }

@font-face { font-family : name ; src : url( url ) ; sRules }

Clarify:

name : font name

url : Specify OpenType fonts with absolute or relative addresses

sRules : pattern table definitions

Set up fonts for embedding HTML documents.

@font-face { font-family: dreamy; font-weight: bold; src: url(http://www.example.com/font.eot); }

At this point, the study on "how to set the font embedded in HTML documents" is over, hoping to solve everyone's doubts. Theory and practice can better match to help everyone learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!

Tags: Fonts documents learning more help practical next all addresses furnishings articles methods patterns browsers theory knowledge address articles websites materials Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Apple Xiaomi vpn OPPO Reno