Home  >  Article  >  Web Front-end  >  Detailed explanation of the use of css word-wrap attribute

Detailed explanation of the use of css word-wrap attribute

黄舟
黄舟Original
2017-06-20 13:29:073092browse

This is a simple code that allows long words to be displayed in new lines when the outer frame is not large enough. It is still very useful in many English web page editors.

Syntax:

word-wrap : normal | break-word

Parameters:

normal: Allow content to break the specified container boundary
break-word: Content will be at the boundary Line break inside. If necessary, intra-word line breaks (word-break) can also occur

Description:

Set or retrieve whether to break the line when the current line exceeds the boundary of the specified container. .
The corresponding script feature is wordWrap. Please see other books I have written.

Example:

div { word-wrap: break-word; }

Code application. In this example, we split long words.

p.test {word-wrap:break-word;}

This word-wrap is supported by all browsers.

Usage of word-wrap, its default value is normal, its inheritance property is yes, and its version is CSS3

style process. When using this code, you must define the outer frame.

<style> 
p.test
{
width:11em; 
border:1px solid #000000;
word-wrap:break-word;
}
</style>

Word-wrap java application. One assignment is done.

object.style.wordWrap="break-word"

Word-wrap’s syntax word-wrap: normal|break-word;

Two different parameter values. One is the browser default, and the other is word disconnection.

The above is the detailed content of Detailed explanation of the use of css 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