Home >Web Front-end >CSS Tutorial >How to use word-wrap attribute

How to use word-wrap attribute

青灯夜游
青灯夜游Original
2019-01-30 14:36:006713browse

The word-wrap attribute is used to automatically wrap long words or URL addresses at the boundaries of the container.

How to use word-wrap attribute

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:

How to use word-wrap attribute

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn