Home > Web Front-end > HTML Tutorial > Problem with p tag misalignment in html

Problem with p tag misalignment in html

黄舟
Release: 2017-07-03 13:48:37
Original
3548 people have browsed it

<br></p>

Problem with p tag misalignment in html</p>

The misalignment phenomenon as shown in the picture: </p>

<html>
<head>
    <title>sda</title>
    </head>
    <body align=center>
    <p>故人西辞黄鹤楼    
    <p>烟花三月下扬州    
    <p>黄鹤一去不复返    
    <p>白云千载空悠悠    
    <br>
    <img  src="/static/imghw/default1.png"  data-src="https://img.php.cn/upload/article/000/000/194/1c4fb9ee594029281cc632da83a62d90-1.png"  class="lazy"  align=center src= "1.png" alt="Problem with p tag misalignment in html" >
    </body>
    </html>
Copy after login

Problem with p tag misalignment in html</p>

has been corrected as shown
There are many solutions
But the principle they all adhere to is the issue of grammatical standards
1. Complete the p tag. The p tag can exist alone, but if it is written in a standardized way, try to complete it
2. The p tag Setting the text-align attribute to center can also solve
3. As discovered by 1, in fact, the <br> tag does not implement line wrapping, but It’s like giving a completion to the back tag of p. When the last p tag is replaced with </p>, it is obvious that there is an extra blank line between the picture and the text. This Can the blank line be understood as the function completion of the p tag or the function execution of the br tag? </p>

<html>
<head>
    <title>sda</title>
    </head>
    <body align=center>
    <p>故人西辞黄鹤楼    
    <p>烟花三月下扬州    
    <p>黄鹤一去不复返    
    <p>白云千载空悠悠</p>
    <br>
    <img  align=center src= "1.png" alt="Problem with p tag misalignment in html" >
    </body>
    </html>
Copy after login

Another big guy said: </p>

<br> If it is written at the beginning of the line, if the previous line is displayed to the end, it may be between the two lines Leave one extra line empty. It is better to write the <br> tag at the end of the line. </p>

The above is the detailed content of Problem with p tag misalignment in html. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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