HTML paragraph
1. Definition
The so-called paragraph, the English word is "paragraph" and the label is <p>, which represents a paragraph in the text.
2. Grammar
<p>Text content</p>
3. Attribute
align, alignment . The values are: left (left), right (right), center (center).
<p align="center">Paragraph text</p>, this piece of code means that the text is left aligned.
4. Note
1. <p> tags normally appear in pairs, although in actual use, only <p> is often seen but not< ;/p>, but Brother Hong still recommends that writing should be standardized.
2. The <p> tag is a segment, and the <br> tag is a line break. The main difference between the two is that the line spacing of the <p> tag is larger than that of the <br> tag.
3. The <p> tag is a block-level element.
Example:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文网(php.cn)</title> </head> <body> <p>段落1</p> <p>段落2</p> <p>段落3</p> </body> </html>
HTML line break
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文网(php.cn)</title> </head> <body> <p>这个<br>段落<br>演示了分行的效果</p> </body> </html>
Note: The <br /> element is an empty HTML element. Since a closing tag doesn't make any sense, it doesn't have a closing tag.
HTML Output - Usage Reminder
We cannot determine the exact effect of the HTML being displayed. The size of the screen, as well as adjustments to the window, may lead to different results.
With HTML, you cannot change the output by adding extra spaces or line breaks to the HTML code.
When displaying the page, the browser will remove extra spaces and blank lines in the source code. All consecutive spaces or empty lines are counted as one space. Note that all consecutive empty lines (newlines) in HTML code are also displayed as a single space.