Home>Article>Web Front-end> How to prevent fonts from wrapping in css3
In CSS3, you can use the "white-space" attribute to prevent the font from wrapping. This attribute is used to handle the white space within the element. When the attribute value is set to "nowrap", the font text will not wrap. Continue on the same line until a newline tag is encountered, the syntax is "white-space:nowrap".
The operating environment of this tutorial: Windows 10 system, CSS3&&HTML5 version, Dell G3 computer.
In css, you can use the white-space attribute to force the text not to wrap; usually we use white-space:nowrap to force the text content not to wrap. The text will be displayed on the same line until the
tag is encountered.
The white-space attribute sets or retrieves the text display mode within the object.
Syntax:
white-space : normal | nowrap;
Attribute value:
normal: Default. White space is ignored by the browser.
nowrap: The text will not wrap. The text will continue on the same line until the
tag is encountered.
Example:
内容将会不被换行显示内容将在一行内强制显示完整
Rendering:
(Learning video sharing:css video tutorial)
The above is the detailed content of How to prevent fonts from wrapping in css3. For more information, please follow other related articles on the PHP Chinese website!