Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use the text-wrap attribute in css

Shulou Source: shulou.com Published: 2022-06-01 11:10:13 11月13日 Update

This article mainly introduces how to use the text-wrap attribute in css, with a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

CSS3text-wrap attribute

What it does: the text-wrap attribute specifies the wrapping (wrapping) rule of the text.

Syntax:

Text-wrap:normal | none | unrestricted | suppress

Normal: line feeds are performed only at allowed line breaks.

None: no line breaks. Text that cannot be contained in the element will overflow.

Unrestricted: wrap lines between any two characters.

Suppress: line breaks in compressed elements. The browser wraps only when there are no other valid line wrapping points in the line.

Note: the text-wrap attribute is not supported by mainstream browsers at present.

An example of using the CSS3text-wrap attribute

P.test1

{

Width:11em

Border:1pxsolid#000000

Text-wrap:none

}

P.test2

{

Width:11em

Border:1pxsolid#000000

Text-wrap:normal

}

This paragraph contains some text. The text on this line does not wrap to the next line.

This paragraph contains some text. The text on this line wraps normally. .

Thank you for reading this article carefully. I hope the article "how to use text-wrap attributes in css" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Tags: Attributes articles one line text elements text browser support browsing on-line valid two mainstream value role interest at the same time characters more friends Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Microsoft Redmi Apple MariaDB