Home  >  Article  >  Web Front-end  >  How to set html without line breaks

How to set html without line breaks

藏色散人
藏色散人Original
2021-04-02 10:02:0420258browse

htmlHow to set no line wrapping: First write the corresponding code in the Html, div and textarea controls; then add the "white-space: nowrap;" style to achieve no line wrapping of the text.

How to set html without line breaks

The operating environment of this article: Windows7 system, HTML5&&CSS3 version, DELL G3 computer

1. First, we write in Html, div and textarea controls The corresponding code has some text content.

How to set html without line breaks

2. In order to prevent it from wrapping, you can directly add a style. white-space: nowrap; is a style that prevents text from wrapping.

How to set html without line breaks

#3. Now view the page, the text will not wrap, and the text input box has a scroll bar. But the content in the div is too long to display and it's not pretty. In order to prevent the div from being displayed too long, we can add another style, overflow: hidden; this is to allow long content to be automatically hidden.

How to set html without line breaks

Recommended study: "HTML Video Tutorial"

The above is the detailed content of How to set html without line breaks. 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