What Does p mean in HTML?
In this article, we will see what does p tag mean in HTML and how to use it. The <p> tag defines a paragraph, so we can create the paragraphs using the <p> tag. It is paired tag, so we need to create an opening <p> and closing </p> tag. It is a block-level element, which means if you create two <p> tags separately, It will display two separate lines. The block-level elements occupy the full width of the screen defaults. Let’s see the example of creating paragraphs using <p> tag:
Example of Create HTML p tag
<html>
<head>
<title>p tag</title>
</head>
<body>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</body>
</html>
Output:
- In the above code, we have created a opening and closing <p> tag inside the body section.
- Within the p tag, we have put some paragraphs.
- See the above output, the p tag is displayed successfully.
This tag has “title” attribute, It helps us to display the title when the user hovers over the paragraph using the mouse. Let’s see example:
Example of using title attribute of p tag
<html>
<head>
<title>p tag title attribute</title>
</head>
<body>
<p title="Title">This is Paragraph Text</p>
</body>
</html>
Output:
- Here, we have created <p> tag and inside it some text.
- Then we used the “title” attribute of the <p> tag and give value to “Title”.
- See, the above output, the text “Title” has been displaying when I touch the paragraph text using the mouse.
Conclusion
The <p> accepts many attributes like align, class, id, style, etc. It also accepts the event attributes in HTML. I hope you have understood a little about the HTML p tag in this article. If you have any doubts about this then please comment below.