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

Detailed explanation of the use of css word-wrap attribute

黄舟
Release: 2017-06-20 13:29:07
Original
3134 people have browsed it

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
Copy after login

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; }
Copy after login

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

p.test {word-wrap:break-word;}
Copy after login

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>
Copy after login

Word-wrap java application. One assignment is done.

object.style.wordWrap="break-word"
Copy after login

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!

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template