The specific implementation of div not automatically wrapping and forcing not wrapping in html

The specific implementation of div not automatically wrapping and forcing not wrapping in html
1. Use the <nobr> tag to achieve no line break

Copy code
The code is as follows:

<div>Hello world! <nobr> Hello world!<nobr></div>

2. Use the <nowrap element> tag

Copy code
The code is as follows:

<div nowrap>Hello world! Hello world! Hello world! Hello world!</div>

3 Force no line break

Copy code
The code is as follows:

div{
white-space:nowrap;
}

4. If there are two divs, float can be used to avoid line breaks

Copy code
The code is as follows:

<div class="class1">hello</div>
<div class="class2">world! </div>
.class1 {float:left;}

5. Display can also be used in div to achieve no line break

Copy code
The code is as follows:

<div class="class1">hello</div>
<div class="class2">world! </div>
.class1 {display:inline;}
.class2{display:inline;}

<<:  Linux service monitoring and operation and maintenance

>>:  MySQL Series 12 Backup and Recovery

Recommend

mySQL server connection, disconnection and cmd operation

Use the mysql command to connect to the MySQL ser...

Several ways to center a box in Web development

1. Record several methods of centering the box: 1...

Tic-Tac-toe game implemented in pure CSS3

Operation effect: html <div class="tic-ta...

Solutions to invalid is Null segment judgment and IFNULL() failure in MySql

MySql Null field judgment and IFNULL failure proc...

Solve the problem that await does not work in forEach

1. Introduction A few days ago, I encountered a p...

Problems and solutions of using TweenMax animation library in angular

I have nothing to do recently, so I tinker with C...

Summary of various methods of MySQL data recovery

Table of contents 1. Introduction 2. Direct recov...

What is Makefile in Linux? How does it work?

Run and compile your programs more efficiently wi...

vue+springboot realizes login verification code

This article example shares the specific code of ...

Web Design Tutorial (4): About Materials and Expressions

<br />Previous Web Design Tutorial: Web Desi...

React implements the sample code of Radio component

This article aims to use the clearest structure t...

Common commands for mysql authorization, startup, and service startup

1. Four startup methods: 1.mysqld Start mysql ser...

Summary of WEBAPP development skills (notes for mobile website development)

1. To develop web responsively, the page must ada...