Home > Web Front-end > CSS Tutorial > What is the css code to force text not to wrap?

What is the css code to force text not to wrap?

藏色散人
Release: 2020-11-25 11:26:23
Original
2555 people have browsed it

The css code to force text not to wrap is "div{white-space:nowrap;}", in which the white-space attribute sets how to handle whitespace within the element, and the attribute value normal causes the whitespace to be ignored by the browser.

What is the css code to force text not to wrap?

Recommended: "css video tutorial"

  • This method is suitable for any brand computer.

css enforces text not to wrap. Code

Forcing text not to wrap, just use white-space:nowrap.

CSS settings do not convert:

overflow:hidden

hidden

white-space: normal

Default

pre

Newlines and other 1653 whitespace characters will be protected

nowrap

Force all text to be displayed on the same line until the end of the text or encounter

br

Object

Example, force no line breaks

The code is as follows

 div{
  white-space:nowrap;
  }
Copy after login

The above is the detailed content of What is the css code to force text not to wrap?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
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