This article introduces you to various implementations of p in HTML without automatic line wrapping. For example, you can use the nobr tag to achieve non-line wrapping, use the nowrap element, etc. Interested friends can refer to the following
1. Use the
The code is as follows:
<p>Hello world!<nobr> Hello world!<nobr></p> 2.用<用nowrap元素>标签
The code is as follows:
<p nowrap>Hello world! Hello world! Hello world! Hello world!</p>
3Force no line breaks
The code is as follows:
p{ white-space:nowrap; }
4. If there are two p, you can use float to achieve no line breaks
The code is as follows:
<p class="class1">hello </p> <p class="class2">world! </p> .class1 {float:left;}
5. Display can also be used in p to achieve non-line wrapping.
The code is as follows:
<p class="class1">hello </p> <p class="class2">world! </p> .class1 {display:inline;} .class2{display:inline;}
More details on how divs in HTML do not automatically wrap and are forced not to wrap. For articles related to implementation methods, please pay attention to the PHP Chinese website!