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 display half of each line of text with div css

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

Share

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

This article mainly explains "how to display half of each line of text in div css". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to display half of each line of text in div css"!

The content of each line of one or more lines of ink in CSS DIV cannot be displayed completely, there is a little overlap between the upper and lower lines, and only half of the font is shown. In the lower version of IE, it is obvious that the font is incomplete, and it is better to test it in higher versions of IE browsers such as Google dabbling device.

Proficient in the organization is particularly fond of the DIV box in the pen and ink font appears incomplete, so that the high and low line calligraphy is a little stacked.

The composition of this font in the DIV+CSS layout is incomplete, revealing the reason why there is a little overlap in multiple lines of calligraphy at the same time:

Css line height is less than CSS font size

Meaning: configure the font text size value in the CSS construction to be greater than the line height value.

The above screenshot corresponds to the HTML code:

CSS5 instance. CSS5 {line-height:16px;font-size:22px} Test content reveals endless mode CSS5 instance calligraphy shows that half of the CSS5 instance pen and ink cannot be broken

It can be seen that "class=" CSS5 "corresponds to the CSS setting line height css line-height configuration 16px, while the font size css font-size setting device is set to 22px, and the significant font size is 22px greater than css line height 16px.

Design method: in this case, for example, if the font size does not change, configuring the value of line-height greater than or equal to 22px can be delusional.

CSS5 instance. CSS5 {line-height:22px;font-size:22px} Test content reveals incomplete content CSS5 instance calligraphy emerges half of CSS5 instance pen and ink cannot show broken

Here the value of the code line-height is set to 22px (just set line-height greater than 22px), which is exactly different from the font size value. In this way, it is good to imagine that multiple lines of calligraphy have stacked overlapping scenes and also intend that the font display is incomplete.

At this point, I believe you have a deeper understanding of "how to display half of each line of text in div css". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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