HTML Tutorial

INTRODUCTION

Edit Template

HTML Tutorial

INTRODUCTION

Edit Template

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.

				
					<p>This is a simple paragraph in HTML.</p>


				
			

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.

				
					<p class="note" style="color: green; font-size: 18px;">
  This paragraph is styled with inline CSS.
</p>

				
			

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:

Scroll to Top