- Home
- /
- Paragraph Tag
HTML Tutorial
INTRODUCTION
HTML BASIC TAGS
INLINE & BLOCK ELEMENTS
HTML LISTS
HTML TABLES
HTML FORMS
HEAD ELEMENTS
HTML MEDIA
MISCELLANEOUS TAGS
- Home
- /
- Paragraph Tag
Paragraph Tag
To write organized and readable text in HTML, the <p>
tag is used to define paragraphs. It helps break large blocks of text into smaller, manageable chunks, improving both clarity and presentation.
<p>
Tag: Defining a Paragraph
The <p>
tag is used to wrap a block of next and turn it into a paragraph. By default, browsers add vertical spacing above and below paragraphs to separate them visually from other content. Each paragraph must be enclosed between an opening <p>
tag and a closing </p>
tag.
This is a simple paragraph in HTML.
Attributes and Styling Options
Although basic in function, the paragraph tag can be enhanced using attributes like class
, id
, and style
. These allow you to apply CSS styles for color, font, spacing, and more.
This paragraph is styled with inline CSS.
Best Practices
Avoid using <p>
tags to structure layout. They are meant purely for textual content. For page structure, you’ll soon learn to use elements like <section>
, <article>
, and <div>
(for general grouping).
Using semantic tags makes your code more meaningful and accessible for search engines and assistive technologies.
Here is example of a paragraph in HTML:
