"I am Saqib Jahangir. A passionate vlogger, software engineer, and avid traveler with a deep love for exploring the hidden gems of our beautiful planet. With a strong foundation in Application Development, Application Architecture & Database Design and Product Management, I bring over a decade of hands-on experience building secure, scalable, and resilient web applications for a diverse range of industries."

Paragraphs

In HTML, paragraphs are defined using the <p> tag. Paragraphs help break your content into readable blocks of text. Each <p> element creates space before and after the paragraph, making your content more structured and easier to read.

๐Ÿ“Œ Syntax:

<p>This is a paragraph of text.</p>

๐Ÿง  Key Points:

·         The <p> tag is a block-level element, which means it always starts on a new line.

·         Browsers automatically add some spacing (margin) before and after a paragraph.

·         Text within <p> tags will automatically wrap to the next line when it reaches the end of the container.

Example:

<!DOCTYPE html>
<html>
<head>
    <title>Paragraph Example</title>
</head>
<body>
    <h1>Welcome to My HTML Page</h1>
 
    <p>This is the first paragraph. It introduces you to the content of the page.</p>
 
    <p>This is another paragraph. Notice how each paragraph is separated by some space.</p>
</body>
</html>

๐Ÿงช Testing with XAMPP/WAMP:

1.      Open your code editor and create a new file named paragraph-example.html.

2.      Paste the example code above.

3.      Save the file in your XAMPP or WAMP www or htdocs folder.

4.      Open your browser and navigate to:

http://localhost/paragraph-example.html

5.      You will see the heading and two paragraphs displayed with spacing in between.

๐Ÿ’ก Tips:

·         Don’t use <p> tags around other block-level elements like <div>, <table>, or another <p>. Nesting block elements inside <p> is invalid HTML.

·         For line breaks inside a paragraph without starting a new paragraph, use the <br> tag.

<p>This is a single paragraph.<br>But this part appears on a new line.</p>

 


Popular Posts

Setting Up Your First Project Folder and Installing XAMPP or WAMP

Frontend vs Backend vs Full Stack