How to create a new line in a p tag of HTML
When writing a paragraph tag (<p>), especially in a WYSIWYG (What You See Is What You Get) HTML editor, pressing the Enter key creates a new paragraph and not a new line. To create a new line in an HTML paragraph tag, follow the steps below depending on how you are writing the HTML.
Creating a new line in HTML code
If you are writing the HTML, you can create a new line using the <br> (break) tag, as shown in the example below.
Example code
<p>Example of <br>text that is using<br>the <br> tag to break<br>a paragraph.</p>
Example code output
Example of text that is using the <br> tag to break a paragraph.
Creating a new line in WYSIWYG editor
A new line can be created in WYSIWYG editors. Examples include the online editor used in a CMS (Content Management System) program, like WordPress, or an HTML editor, like Dreamweaver, with a keyboard shortcut. Most programs and online forms support the Shift+Enter keyboard shortcut. To use this shortcut, move to the text cursor to where you want the new line to begin. Then, press and hold Shift, and press Enter.
If this keyboard shortcut does not work, it is likely only possible to enter a new line by manually inserting a line break ("<br>" tag) in the document's HTML code.