Today I found a problem in HTML. There are many default fonts provided to us, but except for those "Bold", "Song", "Kai" and other fonts that support Chinese, the rest do not know Chinese fonts. What if we need to use our favorite fonts? Is it possible to introduce custom downloaded fonts in CSS3? If possible, how should we introduce it? With this series of problems, let's look at the solution. Nothing is better than seeing the effect. Here are the effects of three fonts on the web page: "Spring Festival Couplets Standard Font", "Jiangnan Artistic Font" and "Mao Zhedong Artistic Font": Google Chrome: Firefox: The above is a demonstration of the effect, just for your reference! First, we need to import a font. We should have such a font (users do not need it). Download the font and put it in the font folder of the project. You can download the fonts online or here. After the download is complete, we will introduce the fonts. HTML code: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Font file test</title> </head> <body> <div class="chunlian">Spring Festival couplets standard font test</div> <div class="jiangnan">Jiangnan Artistic Font Test</div> <div class="maozedong"> Mao Zedong font test</div> </body> </html> Then the CSS style settings: <style type="text/css"> @font-face { font-family:'chunlian'; src: url(font/chunlian.ttf); } @font-face { font-family: 'jiangnan'; src:url(font/jiangnan.ttf); } .chunlian{ font-family: 'chunlian'; font-size: 50px; text-shadow: none; } .jiangnan{ font-family: 'jiangnan'; font-size: 40px; } @font-face { font-family: 'maozedong'; src:url(font/maozedong.ttf); } .maozedong{ font-family: 'maozedong'; font-size: 50px; text-shadow: none; } </style> If you want to add other fonts, just write @font-face in CSS! This is the end of this article about introducing multiple custom fonts in CSS3. For more information about introducing custom fonts in CSS3, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future! |
<<: Nginx configuration file detailed explanation and optimization suggestions guide
>>: Vue2.0 implements adaptive resolution
Here are the types of data that can be verified l...
1. System environment [root@localhost home]# cat ...
We often need to control the hidden, transparent ...
First of all, let me talk to you about my daily l...
Preface The master-slave replication relationship...
This article example shares the specific code of ...
Introduction The Docker community has created man...
I. Introduction First, let me explain the version...
In the MySQL documentation, MySQL variables can b...
This article introduces several methods of implem...
There are some differences between filter and bac...
ylbtech_html_print HTML print code, support page t...
1. scale() method Zoom refers to "reducing&q...
Table of contents 1. Open source warehouse manage...
Part 3: ❤Three ways to overlook backend data rece...