" tag, and the syntax is " Home >Web Front-end >Front-end Q&A >How to force html5 text not to wrap In HTML5, you can use the style attribute together with the "white-space" attribute to set the text to force no line breaks; the style attribute is used to set the style of the element, and the "white-space" attribute is used to specify the white space within the element. How to deal with it, when the "white-space" attribute value is set to nowrap, the text will not wrap until it encounters the " The operating environment of this tutorial: Windows 10 system, CSS3&&HTML5 version, Dell G3 computer. The white-space attribute specifies how to handle the white space within the element. normal Default. White space is ignored by the browser. pre White space will be preserved by the browser. It behaves like the nowrap The text will not wrap; the text will continue on the same line until the pre-wrap Preserves whitespace sequences, but wraps normally. pre-line merges whitespace sequences but retains newlines. The example is as follows: Output result: (Learning video sharing: css video Tutorial,html video tutorial) The above is the detailed content of How to force html5 text not to wrap. For more information, please follow other related articles on the PHP Chinese website!How to force html5 text not to wrap
" tag, the syntax is "How to force text in html5 not to wrap lines
tag in HTML.
tag is encountered. <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>123</title>
<style>
div{
width: 120px;
height: 60px;
line-height: 20px;
border: 1px solid red;
}
</style>
</head>
<body>
<div style="white-space:nowrap">
This is some text. This is some text.
</div>
<div>
This is some text. This is some text.
</div>
</body>
</html>