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

WBOY
Release: 2016-06-24 11:55:35
Original
992 people have browsed it

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.

source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template