Html code to enter new line
In HTML, you can enter a new line using the <br>
element, which stands for "break". This element is used to insert a line break in the text.
Here is an example:
<p>This is the first line of text.<br>This is the second line of text.</p>
When rendered in a web browser, this code will display as:
This is the first line of text. This is the second line of text.
Alternatively, you can use the <p>
element with a blank space to create a new line:
<p>This is the first line of text.</p>
<p>This is the second line of text.</p>
This will also create a new line, but it will also create a new paragraph.
You can also use the
or
entities to represent a new line:
<p>This is the first line of text. This is the second line of text.</p>
Or:
<p>This is the first line of text. This is the second line of text.</p>
Note that the
and
entities are not supported in all browsers, so it's recommended to use the <br>
element instead.