Home >Web Front-end >HTML Tutorial >Problem with p tag misalignment in html
<br>
The misalignment phenomenon as shown in the picture:
<html> <head> <title>sda</title> </head> <body align=center> <p>故人西辞黄鹤楼 <p>烟花三月下扬州 <p>黄鹤一去不复返 <p>白云千载空悠悠 <br> <img align=center src= "1.png" alt="Problem with p tag misalignment in html" > </body> </html>
has been corrected as shown<br>There are many solutions<br>But the principle they all adhere to is the issue of grammatical standards<br>1. Complete the p tag. The p tag can exist alone, but if it is written in a standardized way, try to complete it<br>2. The p tag Setting the text-align attribute to center can also solve <br>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
<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>
Another big guy said:
<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.
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!