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 realize line break in CSS3

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

Share

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

This article introduces the relevant knowledge of "how to achieve line change in CSS3". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

CSS3TextOverflow attribute

The CSS3 text overflow property specifies how the overflow content should be displayed to the user

Example

P.test1 {

White-space: nowrap

Width: 200px

Border: 1px solid # 000000

Overflow: hidden

Text-overflow: clip

}

P.test2 {

White-space: nowrap

Width: 200px

Border: 1px solid # 000000

Overflow: hidden

Text-overflow: ellipsis

}

Line feeds of CSS3

If a word is too long to fit in an area, it extends to the outside:

In CSS3, the auto-wrap attribute allows you to force text wrapping-even if it means splitting a word in the middle of it:

The CSS code is as follows:

Example

Allow long text to wrap:

P {word-wrap:break-word;}

CSS3 word splitting and newline

The CSS3 word split newline property specifies the newline rule:

The CSS code is as follows:

Example

P.test1 {

Word-break: keep-all

}

P.test2 {

Word-break: break-all

}

This is the end of the content of "how to change lines in CSS3". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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