Add new line in paragraph html
To add a new line in a paragraph in HTML, you can use the <br>
tag, which stands for "break". This tag will insert a line break in the text, creating a new line.
Here is an example:
<p>This is the first line of the paragraph.<br>This is the second line of the paragraph.</p>
This will render as:
This is the first line of the paragraph. This is the second line of the paragraph.
Alternatively, you can use the <p>
tag with a newline character (\n
) in the text:
<p>This is the first line of the paragraph.\nThis is the second line of the paragraph.</p>
This will also render as:
This is the first line of the paragraph. This is the second line of the paragraph.
Note that the <br>
tag is more commonly used to add a line break in a paragraph, while the newline character (\n
) is more commonly used in code or in a text editor.
You can also use the <p>
tag with multiple paragraphs:
<p>This is the first paragraph.</p>
<p>This is the second paragraph.</p>
This will render as:
This is the first paragraph.
This is the second paragraph.