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 compatibility problem of commonly used CSS browsers

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly explains "how to solve the compatibility problem of common CSS browsers". The explanation content in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian to study and learn "how to solve the compatibility problem of common CSS browsers" together.

First, the last row of ink exceeds the DIV border

The last row or rows of calligraphy often appear across the DIV border in the structure.

1, HTML broken source code as follows:

Disclosure of CSS5 instances is incomplete or exceeds straddle.CSS5 { border:1px solid #000; width:200px; height:50px;line-height:20px} The last row of text reflects the endless last row of text reveals the performance of half the test DIVCSS example test

2. Screenshot of css font text higher than DIV border

3, analysis of the reason for the above calligraphy font form display over the DIV model is the height setting equipment error, the box height is 50px, css line height is 20px, then three rows of text will occupy 60px height, but the height is set equipment is 50px, artificial height is less than 10px, in the high version of the reader will appear this type of pattern overflow signs.

4, design method operation at the end of a row revealed to catch up with the title there are four ways: the first, the altimeter is better, the above to typeset three rows of mode, and line-height set to 20px, then the height is set to 3 times 20=60px (at least equal to or greater than 60px).

The second kind, remove the height of the color, if not sure how many DIV box installed in a number of forms, the simplest way is also the general film door diameter is to cancel the DIV height settings equipment, what DIV will increase with the form

Third, modify the line-height height, assuming that your CSS mechanism height is fixed, and the display content is still and want to be complete, only correct the value of css line-height, this case 50 divided by 3=16.6, then line-height setting integer 16px can be intended content overflow fixed height.

The fourth kind, reduces the content, here displays is three row forms, you only have to ask removes one row, lets the pattern display only two rows to be possible to handle.

Second, the last row of calligraphy font shows half

In addition to the above questions, many time layout, catch up with the content of DIV actually do not overflow but hidden do not show, how to covet?

HTML+CSS example code

CSS5 {border:1px solid #000;width:200px;overflow:hidden;height:50px;line-height:20px} End of a row of ink appears endless end of a row of ink appears half test DIVCSS example test

2. Screenshot of case attainments

3, css layout ink display incomplete reason synthesis above case and the first overflow DIV box code is the same, but more overflow:hidden pattern. This "overflow:hidden" pattern has the form of a latent DIV exceeding the stride, so that the end row of text appears incomplete or only half revealed.

4, dot way remediation method can refer to the previous CSS compatible title problem "the last row of text across the DIV border" lost a good attempt.

4-1: Reduce the number of lines of calligraphy (reduce one line here)

4-2: Configuration height, height total good

4-3: Do not set height

4-4: Total corrected line-height values in a fixed height environment.

Thank you for reading, the above is the content of "how to solve the compatibility problem of common CSS browsers". After studying this article, I believe that everyone has a deeper understanding of how to solve this problem for the compatibility problem of common CSS browsers. The specific use situation also needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

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