- Read Tutorial
- Watch Guide Video
- Complete the Exercise
In this segment, we are going to walkthrough the basics of paragraph tags. In general, it's common practice to place all content inside paragraph tags, giving it an overall improved structure.
Implementing a paragraph tag is fairly simple. You must include a <p>
opening tag before your content, and end the paragraph with a </p>
closing tag. As a result, content will appear as so:
<p> My first type of content </p>
While using paragraph tags, there will be padding around your content. This is a default in HTML with this type of tag.
This tag is exceptionally useful when you need several sentences similar to the typical paragraph, as you can visualize the same structure in your browser as well.
A readable structure is vital for any corporate website or blog that you will create.
Although paragraphs are not limited, it's recommended to have the opening and closing tag on a new line as we did for the <div>
tag earlier. This helps with code readability, and also reduces the possibility of omitting the closing tag. However, this step is optional and will change nothing on the browser.
Paragraph tags are relatively straightforward. The main purpose of them is to create its own padding and new line characters.