HTML Paragraph Element

HTML Paragraph <p> tag is used to define a paragraph in HTML document.

Example

A simple Paragraph element is shown in the following example.

index.html

Note: HTML Paragraph element starts with the tag <p> and ends with an end tag </p>.

ADVERTISEMENT

Default CSS for Paragraph

By default, following CSS properties are set for a paragraph.

display: block;
margin-block-start: 1em;
margin-block-end: 1em;

Inline Style for HTML Paragraph

We can change the style of paragraph through inline styling using style attribute.

In the following program, we have set the color as red, and background as black color for the Paragraph element.

index.html

Apply CSS for a Paragraph

We can apply CSS for all paragraphs using the p tag.

index.html

Conclusion

In this HTML Tutorial, we learned about HTML Paragraph tag and went through different examples that cover defining a Paragraph element, and styling it.