Home >Web Front-end >HTML Tutorial >Specific implementation of div in HTML not automatically wrapping or forcing no wrapping_HTML/Xhtml_Web page production

Specific implementation of div in HTML not automatically wrapping or forcing no wrapping_HTML/Xhtml_Web page production

WBOY
WBOYOriginal
2016-05-16 16:38:591659browse

1. Use the tag to achieve no line breaks

Copy the code
The code is as follows:

Hello world! Hello world!


2. Use tag

Copy code
The code is as follows:

Hello world! Hello world! Hello world! Hello world!


3 Force no line breaks

Copy the code
The code is as follows:

div{
white-space:nowrap;
}

4. If there are two divs, you can use float to achieve no line wrapping

Copy code
The code is as follows:

hello

world!

.class1 {float:left;}

5. You can also use display in div to achieve no line breaks

Copy code
The code is as follows:


world!

.class1 {display:inline;}
.class2{display:inline;}
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