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?

藏色散人
藏色散人Original
2020-11-25 11:26:232545browse

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;
  }

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!

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
Previous article:How hbuilder quotes cssNext article:How hbuilder quotes css