In HTML, the <p>
tag is used to define a paragraph. The text within the <p>
tags is displayed as a separate paragraph on the web page. Here’s an example of a paragraph in HTML:
<p>This is a sample paragraph in HTML. It demonstrates how to create a paragraph using the <p> tag. The text within the <p> tags is displayed as a separate paragraph on the web page.</p>
It’s important to note that each <p>
tag creates a new paragraph, so if you want to make multiple paragraphs on your web page, you’ll need to use various <p>
tags.
In addition to creating paragraphs, the <p>
The tag also has some default styling applied to it. For example, most browsers display a margin above and below the text within the <p>
tag, which creates space between the paragraphs.
You can also use CSS to style the paragraphs, such as changing the font size, font family, color, background color, etc. Here’s an example of how you could use CSS to style a paragraph:
<p style="font-size: 20px; font-family: Arial; color: blue;">This is a sample paragraph with custom styling using CSS.</p>
In this example, we’ve used the style
attribute to specify the font size, font family, and color of the text within the <p>
tag.