Skip to main content
Practice

p Tag

The <p> tag is used to insert paragraphs of text on a webpage.

The main characteristics of the p tag are as follows:

  1. Automatic Line Breaks: If the length of the paragraph exceeds the width of the browser, the text will automatically wrap to the next line.

  2. Nesting Not Allowed: You cannot include other elements (e.g., another <p> tag, <div>, etc.) within a <p> tag. The <p> tag should only contain text.

The p tag can be used as shown below:

p Tag
<p>First paragraph</p>
<p>Second paragraph</p>

Follow the highlighted parts of the code to enter it correctly.

Want to learn more?

Join CodeFriends Plus membership or enroll in a course to start your journey.