Home > Web Front-end > Front-end Q&A > How to set nested p tags not to wrap in html5

How to set nested p tags not to wrap in html5

WBOY
Release: 2022-01-23 15:55:25
Original
4287 people have browsed it

In HTML5, the display attribute can be used to set the nested p tag to be displayed without wrapping. The function of this attribute is to specify the type of element generation box. When the value of the attribute is set to "inline", there will be no line before and after the element. Line breaks will be displayed without line breaks, and the syntax is "

".

How to set nested p tags not to wrap in html5

The operating environment of this tutorial: Windows 10 system, HTML5 version, Dell G3 computer.

html5How to set the nested p tag not to wrap

The display attribute specifies the type of box that the element should generate.

Some of the attribute values ​​​​of this attribute are as follows:

How to set nested p tags not to wrap in html5

The example is as follows:

<html>
<head>
<meta charset="utf-8"> 
<title>123</title>
</head>
<body>
<div>
<p style="display:inline;">这两个段落生成内联盒子,和它的结果</p>
<p style="display:inline;">这两个元素之间没有距离。</p>
</div>
</body>
</html>
Copy after login

Output result:

How to set nested p tags not to wrap in html5

Recommended tutorial: "html video tutorial"

The above is the detailed content of How to set nested p tags not to wrap in html5. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template