HTML Paragraph क्या होता है?
HTML Paragraph का उपयोग web page पर text content को readable format में दिखाने के लिए किया जाता है।
Paragraphs content को logical blocks में divide करते हैं, जिससे user आसानी से text को पढ़ और समझ सके।
HTML में paragraph बनाने के लिए <p> tag का उपयोग किया जाता है।
Basic HTML Paragraph Example
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
Browser automatically:
- हर paragraph से पहले और बाद space देता है
- Paragraph को new line से start करता है
HTML Paragraph Behavior
HTML में:
- Extra spaces और new lines ignore कर दी जाती हैं
- Browser text को continuous flow में render करता है
Example:
<p>
This is
a paragraph
with many lines
</p>
Output:
This is a paragraph with many lines
Line Break in HTML
Line break देने के लिए <br> tag का use किया जाता है।
Example:
<p>Hello<br>World</p>
<br> एक empty element है और इसका closing tag नहीं होता।
Horizontal Rule <hr>
<hr> tag content के बीच horizontal line show करता है।
Example:
<hr>
यह visual separation के लिए use होता है।
<pre> Tag (Preformatted Text)
अगर आप text को वैसे ही display करना चाहते हैं जैसा लिखा गया है, तो <pre> tag का use करें।
Example:
<pre>
This is preformatted text
Line breaks and spaces
are preserved
</pre>
HTML Paragraph और Text Formatting
Paragraph के अंदर आप text formatting tags use कर सकते हैं।
Example:
<p>This is <strong>bold</strong> and <em>italic</em> text.</p>
Common formatting tags:
<strong>– Important text<em>– Emphasized text
Paragraph Alignment
HTML में alignment अब directly tag से recommend नहीं है।
Alignment CSS से control किया जाता है।
Example (CSS):
<p style="text-align:center;">Centered paragraph</p>
Paragraph और SEO
SEO-friendly paragraphs के लिए:
- Short और meaningful paragraphs लिखें
- Keywords natural तरीके से use करें
- Long blocks avoid करें
- Headings के नीचे relevant paragraphs रखें
Common Beginner Mistakes
- Paragraph के अंदर
<br>का overuse - Long text को बिना paragraph divide किए लिखना
- Text spacing के लिए extra spaces use करना
<p>tag के अंदर block elements डालना
Paragraph vs <div>
| Feature | <p> | <div> |
|---|---|---|
| Purpose | Text content | Container |
| Default Spacing | Yes | No |
| SEO Meaning | Semantic | Non-semantic |
Text के लिए हमेशा <p> prefer करें।
Quick Summary
<p>tag paragraph बनाने के लिए use होता है- Browser extra spaces ignore करता है
- Line break के लिए
<br> - Preformatted text के लिए
<pre>
Practice Questions
- HTML paragraph क्या होता है?
<br>और<p>में difference क्या है?<pre>tag का उपयोग कब करते हैं?
