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