Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem that line-height cannot be vertically centered in IE9 and above browsers

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Most people do not quite understand the knowledge points of this article "how to solve the problem that line-height cannot be vertically centered in IE9 and above browsers", so the editor summarizes the following contents for you. The content is detailed, the steps are clear, and it has a certain reference value. I hope you can get something after reading this article. Let's take a look at this article "how to solve the problem that line-height cannot be vertically centered in IE9 and above browsers".

1. The reason why ie9 line-height works

Chinese calligraphy is used in CSS, while Chinese characters are used in Chinese calligraphy. Such as:

Font-family: Microsoft Yahei

Using CSS font font-family design and color using "Song style", "boldface" or "Microsoft Yahei" and other Chinese characters in the CSS configuration.

In the web page DIV+CSS layout can not resist the use of pen and ink, such as: boldface, Song style, Microsoft Yahei and other Chinese calligraphy, how to accurately use these Chinese font patterns? In the future, we will understand why we want to use these Chinese characters, and they are compatible with IE9 and support IE9 to use Chinese fonts.

Second, the greedy ie9 font is not vertically centered.

1. Convert Chinese characters into Unicode coding.

The corresponding Unicode of "boldface" is "\ 9ED1\ 4F53".

The corresponding Unicode of "Song style" is "\ 5B8B\ 4F53".

The corresponding Unicode code of "imitating Song" is "\ 4EFF\ 5B8B".

The corresponding Unicode code of "Microsoft Acer" is "\ 5FAE\ 8F6F\ 96C5\ 9ED1".

Convert Chinese characters to Unicode-encoded characters, which is not only a success in configuring the corresponding font, but also compatible with IE9 readers in favor of vertically centered line-height.

Real-world application exp:

.div {font-family: "Microsoft Yahi"}

After conversion to Unicode coding

.div {font-family: "\ 5FAE\ 8F6F\ 96C5\ 9ED1"}

In Chinese character fonts, the effect of converting pen and ink to Unicode coding is similar, unaffected, and compatible with major browsers.

What if I can't remember the Unicode code table? In the css font commonly used in CSS+DIV organs, the Chinese ink typeface is only a few boldface, Song style, imitation Song, Microsoft Yahei. If you can't remember or enter the css Unicode coding table to search and copy it.

2. Use the English name of the Chinese character in the CSS+DIV structure to convert the Chinese font in the CSS configuration into the corresponding English name font. After the conversion, the effect of the Chinese font is rigid, and it is compatible with all the major hunting devices.

"boldface" corresponds to the English name "SimHei" and "Song style" corresponds to the English name "SimSun" and "imitating Song" corresponds to "FangSong" and "Microsoft Yahi" corresponding to the English name "Microsoft YaHei".

Use exp in real life:

.div {font-family: "Microsoft Yahi"}

After converting to an English name

.div {font-family: "Microsoft YaHei"}

Css fonts in div css structure are converted from Chinese fonts to English fonts. The font configuration is tough and compatible with major browsers, so we are generally determined to use it.

The above is about the article "how to solve the problem that line-height cannot be vertically centered in IE9 and above browsers". I believe we all have some understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report