In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 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 incomplete display of the last row of text in div css". The content of the explanation in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to solve the incomplete display of the last row of text in div css.
The last row of pen and ink goes beyond the border of DIV
The last row or rows of calligraphy have repeatedly emerged in the organ beyond the DIV frame.
1. The complete HTML source code is as follows:
The performance of CSS5 instances is incomplete or exceeds the span of .CSS5 {border:1px solid # 000; width:200px; height:50px;line-height:20px} A row of text at the end can not be displayed at the end of a row of pen and ink show half of the test DIVCSS instance test
2. Css font pen and ink is higher than the DIV frame screenshot
3, the original analysis of the above pen and ink font content revealed that the performance over the DIV model is a high configuration error, this box height of 50pxmeme CSS line height is 20px, then three rows of calligraphy will occupy the height of 60px, while the height is set to 50px, the natural height is less 10px, in the high version of the hunting device will be flooded with this kind of mode overflow scene.
4. The final row of governance shows that there are four attempts to raise the problem: first, calculate the height well, the above should be typeset in three rows mode, and line-height is configured as 20px, then the height is set to 3 times 20=60px (at least equal to or greater than 60px).
Second, get rid of the height height technique, assuming that you are not sure how many modes are contained in the DIV box, and the simplest double door path is also a common method equal to canceling the height configuration of the DIV, how the DIV will increase with the form.
Third, modify the line-height height. If you are highly static in the CSS structure, and the display mode is fixed and want to appear complete, you can only modify the value of css line-height. In this case, 50 divided by 3: 16.6, then the line-height setting equipment integer 16px can overflow the rest height in mode.
Fourth, the form of reduction, here is a three-row model, you only important to remove one row, so that the form can only reveal the performance of two rows can be planned.
Second, the last row of calligraphy reveals half of the performance
In addition to the above problems in many moment structures, the pattern beyond the DIV does not overflow but does not emerge. How to covet it?
1. HTML+CSS instance code
The appearance of CSS5 instances is incomplete or beyond the span of .CSS5 {border:1px solid # 000xwidthposition 200px overflowed DIVCSS instance test.
2. Screenshot of case effectiveness
3. Css agency pen and ink reveals that the reasons for the incomplete performance are the same as the code of the first overflow DIV box, except for more overflow:hidden colors. This "overflow:hidden" pattern has a pattern of crossing the DIV, so the last line of text appears incomplete or only half exposed.
4, the management method can refer to the previous css compatibility problem "ending a line of text over the DIV frame" to get a good plan. 4-1: reduce the number of ink lines (reduce one line here) 4-2: configure height, height calculation 4-3: do not set height 4-4: in a height fixed environment, calculate the value of modified line-height
Thank you for your reading, the above is the content of "how to solve the incomplete display of the last row of text in div css". After the study of this article, I believe you have a more profound understanding of how to solve the problem of incomplete display of the last row of text in div css, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.