Paragraphs are fundamental building blocks of web content. In HTML, they are created using the <p>
tag. This element is essential for structuring text and improving readability on web pages.
To create a paragraph in HTML, simply wrap your text content within opening and closing <p>
tags:
<p>This is a paragraph of text.</p>
While paragraphs provide structure, you can enhance their appearance using CSS. For example:
<p style="color: blue; font-size: 18px;">A styled paragraph.</p>
However, it's generally better to separate content from presentation by using external CSS files.
Browsers automatically add space before and after paragraphs. This default spacing can be adjusted using CSS margins or padding.
<p>This is the first paragraph.</p>
<p>Here's a second paragraph.</p>
<p>And a third one for good measure.</p>
<p>This paragraph contains <strong>bold text</strong> and an <a href="html-links">HTML link</a>.</p>
To further enhance your HTML skills, explore these related topics:
By mastering HTML paragraphs, you'll be able to create well-structured, readable content for your web pages. Remember to combine them effectively with other HTML elements for the best results.