Home Web Front-end HTML Tutorial Elegantly set web text fonts [original]_html/css_WEB-ITnose

Elegantly set web text fonts [original]_html/css_WEB-ITnose

Jun 24, 2016 am 11:55 AM

Microsoft XP is really "deeply rooted" in China. Although Microsoft has announced that the "death date" of XP has arrived, there are still a large number of XP users in China. 22.2% can be seen.

View for details: https://www.modern.ie/en-us/ie6countdown#list

XP has been serving everyone for more than 10 years. It is already very old. Microsoft also announced that it would stop supporting XP. This was a good thing. However, various domestic manufacturers subsequently announced that they would continue to provide support for XP users with "shelf protection". This is unacceptable. Not saying it is a good thing, but for WEB front-ends who deal with IE6 compatibility every day, it is really not a good thing!

This leads to the fact that the default font of most Chinese websites in China has to give priority to "Song Ti". However, "Song Ti" is not as plump and sharp as "Microsoft Yahei" on Windows Vista. Please take a look below Picture:



Then why not give priority to "Microsoft Yahei"? It's a piece of code.

1

font-family :  '微软雅黑' ,’宋体’...

1

font-family : 'Microsoft Yahei' ,'宋体'...

td>

Doesn’t this sentence solve the problem? At first I thought so too: Vista users who come with the "Microsoft YaHei" font by default will see better text rendering effects on web pages, and XP users who come with "Songti" by default will naturally see the Songti version of the webpage. It looks perfect, okay, let’s take a look at the comparison picture:

Under XP, the left is Song font and the right is Microsoft Yahei.

Now the reverse is true. The display effect of Song font under XP is sharper and more uniform than that of Microsoft Yahei. The display effect of other browsers is also very poor. It can be seen that the above plan has definitely failed. You may argue that this is what you used for testing. XP does not have Microsoft Yahei by default and can be ignored. Yes, but most of them are pirated versions in China. After checking online, various manufacturers’ XP Ghost versions have kindly installed Microsoft Yahei for users. Of course, their manufacturers’ money-making software, website navigation, etc. must be built-in, as well as some designs. You need to install it yourself, so this way is really blocked.

Then let’s default to Song Dynasty and wait for the day when XP disappears completely.

1

font-family :  sans-serif ;

No, let’s analyze it. The default IE6 is probably the most used in XP, and the maximum is only supported up to IE8. That’s easy. Use a hack to write a style specifically for IE8 to IE6:

1


font-family : sans-serif ;

That’s good. As for those who use other browsers under XP, let’s not consider it for now. People who can choose their own browser should also be able to change to a better system, right?

Look at the display under "font-family: sans-serif;"

XP system IE6 display:

Wow, that’s great, and you can see that when Chinese and English are mixed on the left, the English display is even more beautiful. (The mixed Chinese and English display with fixed fonts on the right is a bit ugly)

Win8 system IE11 display:

The left and right displays are consistent, based on the system default The font is displayed in Microsoft YaHei.

Under Win8 system opera:

This is not satisfactory. The left side is displayed in the default Song font. This situation will occur in other On third-party browsers, such as: FirefoxChrome, etc.

OS X Mavericks system Safari 7.0:


The display is also very complete, the English is slightly different, but they are all Very cool.


If you want to view display screenshots of various systems and devices online, you can visit Microsoft's official product (including screenshots displayed under various OSs, various mobile phones, and pad devices):

https ://modern.ie/zh-cn/screenshots

 

font-family :  sans-serif

Please forgive my incoherence. To sum up:

The above method is still not perfect enough. In the latest Windows system Third-party browsers will still display it in Song font (this depends on the font definition of each browser's default style), so the final result is that it is highly not recommended.

But I accidentally discovered that if there is a mix of Chinese and English, you can use

font- family : sans-serif

This is definitely a good choice.

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Difficulty in updating caching of official account web pages: How to avoid the old cache affecting the user experience after version update? Difficulty in updating caching of official account web pages: How to avoid the old cache affecting the user experience after version update? Mar 04, 2025 pm 12:32 PM

Difficulty in updating caching of official account web pages: How to avoid the old cache affecting the user experience after version update?

How do I use HTML5 form validation attributes to validate user input? How do I use HTML5 form validation attributes to validate user input? Mar 17, 2025 pm 12:27 PM

How do I use HTML5 form validation attributes to validate user input?

How to efficiently add stroke effects to PNG images on web pages? How to efficiently add stroke effects to PNG images on web pages? Mar 04, 2025 pm 02:39 PM

How to efficiently add stroke effects to PNG images on web pages?

What is the purpose of the <iframe> tag? What are the security considerations when using it? What is the purpose of the <iframe> tag? What are the security considerations when using it? Mar 20, 2025 pm 06:05 PM

What is the purpose of the <iframe> tag? What are the security considerations when using it?

What are the security implications of using iframes, and how can I mitigate them? What are the security implications of using iframes, and how can I mitigate them? Mar 18, 2025 pm 02:51 PM

What are the security implications of using iframes, and how can I mitigate them?

What are the best practices for cross-browser compatibility in HTML5? What are the best practices for cross-browser compatibility in HTML5? Mar 17, 2025 pm 12:20 PM

What are the best practices for cross-browser compatibility in HTML5?

How do I use the HTML5 <time> element to represent dates and times semantically? How do I use the HTML5 <time> element to represent dates and times semantically? Mar 12, 2025 pm 04:05 PM

How do I use the HTML5 <time> element to represent dates and times semantically?

How do I use the HTML5 <meter> element to display numerical data within a range? How do I use the HTML5 <meter> element to display numerical data within a range? Mar 12, 2025 pm 04:08 PM

How do I use the HTML5 <meter> element to display numerical data within a range?

See all articles