Home >Web Front-end >CSS Tutorial >How to use word-wrap attribute
The word-wrap attribute is used to automatically wrap long words or URL addresses at the boundaries of the container.
CSS3 word-wrap attribute
Function: Allows long words or The URL address wraps to the next line.
Description: Set or retrieve whether to break lines when the content exceeds the boundary of the specified container.
Syntax:
word-wrap: normal|break-word;
normal: Line breaks only at allowed hyphenation points (browser keeps default processing).
break-word: Break lines inside long words or URL addresses.
CSS3 Example of using the word-wrap attribute
<!DOCTYPE html> <html> <head> <style> p{ width:11em; border:1px solid #000000; } p.test { word-wrap:break-word; } </style> </head> <body> <p>dsffdgrh121324gfdgfhhgjhkkjlkl;</p> <p class="test">dsffdgrh121324gfdgfhhgjhkkjlkl;</p> </body> </html>
Rendering:
The above is the entire content of this article, I hope it will be helpful to everyone's study. For more exciting content, you can pay attention to the relevant tutorial columns of the PHP Chinese website! ! !
The above is the detailed content of How to use word-wrap attribute. For more information, please follow other related articles on the PHP Chinese website!