← Back to HTML Course | Chapter 1: Introduction & Basics | Lesson 10 of 11

HTML Quotations

अगर आप एक research paper लिख रहे हैं, तो आप बिना source cite किए अपने text में quotes नहीं डाल सकते। आपको उन्हें अलग तरीके से format करना होगा ताकि आपके readers को पता चले कि वे किसी और के हैं। HTML quotation tags यह काम online करते हैं। वे browser को बताते हैं कि कब text किसी दूसरे page से एक direct quote है। कुछ quotation elements indentations जोड़ते हैं, कुछ अपने आप localized quote marks insert करते हैं, और कुछ तो आपको quote के source code से सीधे link करने भी देते हैं।
Syntax
markup
<blockquote cite="url">Quoted block</blockquote>
<q>Inline quote</q>
<abbr title="Full text">Abbr</abbr>

blockquote Element

blockquote tag बाहरी sources से लिए गए लंबे, multi-line quotations को लपेटता है। ब्राउज़र इन sections को आपके normal body paragraphs से visually अलग करने के लिए स्वचालित रूप से indent कर देता है।

Note:
  • search engines को सीधे source URL से जोड़ने के लिए blockquote के अंदर cite attribute का उपयोग करें।
  • Accepted attributes:
  • cite — quotation के source का URL
  • Global attributes (id, class, lang) भी लागू होते हैं
Warning: blockquote का उपयोग सिर्फ regular text layouts को indent करने के लिए न करें क्योंकि इससे screen-reader accessibility rules टूट जाते हैं।

उदाहरण: The blockquote Element

markup
<blockquote cite="https://example.com/source">
  This is a long quotation taken from an external source,
  which the browser indents to set it apart from the page's normal text.
</blockquote>

q के साथ छोटे Inline Quotes

छोटे quotes के लिए जो एक सामान्य paragraph के अंदर आराम से fit हो जाते हैं, q tag का उपयोग करें। इन quotes को indentations से style करने के बजाय, ब्राउज़र text को स्वचालित रूप से सही quotation marks में लपेट देता है।

Note:
  • q tag के अंदर manually quotation marks टाइप करने से बचें, क्योंकि ब्राउज़र यह आपके लिए करेगा।
  • Accepted attributes:
  • cite — quotation के source का URL
  • Global attributes (id, class, lang) भी लागू होते हैं
Warning: अलग-अलग browsers nested q tags को अलग-अलग quotation styles के साथ render कर सकते हैं, इसलिए अपने nested quotes को simple रखें।

उदाहरण: Short Inline Quotes with q

markup
<p>She said <q>this is a short quote</q> during the interview.</p>

abbr से Abbreviations Define करना

abbr tag abbreviations और acronyms को पहचानता है। इस tag में title attribute जोड़कर, आप पूरा-form text दे सकते हैं। जब user अपने mouse को abbreviation पर hover करता है, तो पूरा text एक छोटे tooltip के रूप में दिखाई देता है।

Note:
  • अपने visitors के लिए abbreviation का पूरा अर्थ बताने के लिए हमेशा title attribute शामिल करें।
  • Accepted attributes:
  • title — abbreviation का पूरा विस्तार
  • Global attributes (id, class, lang) भी लागू होते हैं
Warning: Mobile users hover नहीं कर सकते, इसलिए सुनिश्चित करें कि अगर abbreviation समझने के लिए जरूरी है तो उसे plain text में समझाया गया हो।

उदाहरण: Defining Abbreviations with abbr

markup
<p>The <abbr title="HyperText Markup Language">HTML</abbr> standard defines web page structure.</p>

cite से Creative Work Citations

cite tag का उपयोग किसी creative work के title को पहचानने के लिए किया जाता है, जैसे कोई किताब, गाना, movie, या कोई specific software tool। ब्राउज़र स्वचालित रूप से cite tag के अंदर के text को italics में display करता है।

Note: cite element का उपयोग खासतौर पर works के titles के लिए करें, न कि author के नाम के लिए।
Warning: cite tag को blockquotes के अंदर उपयोग होने वाले cite attribute के साथ confuse न करें।

उदाहरण: Creative Work Citations with cite

markup
<p>My favorite book is <cite>The Great Gatsby</cite>.</p>

bdo से Text Direction Overrides

bdo (Bi-Directional Override) tag आपको text direction को manually reverse करने देता है। यह right-to-left languages (जैसे Arabic या Hebrew) को support करने या quick visual text effects बनाने के लिए बेहद उपयोगी है।

Note:
  • direction control करने के लिए bdo tag के अंदर हमेशा dir attribute specify करें।
  • Accepted attributes:
  • dir — ltr | rtl (bdo पर आवश्यक)
  • lang — en या ar जैसा language code
Warning: bdo का उपयोग बड़े text layouts पर न करें क्योंकि इससे content unreadable हो जाता है और search engines confuse हो जाते हैं।

उदाहरण: Text Direction Overrides with bdo

markup
<bdo dir="rtl">This text will be displayed right-to-left.</bdo>

blockquote पर cite Attribute

blockquote पर cite attribute उस source का URL रखता है जहां से quote लिया गया है। यह default रूप से readers को दिखाई नहीं देता, लेकिन यह ब्राउज़र, search engines, और कुछ assistive tools को original source तक वापस जाने का एक machine-readable link देता है।

Note:
  • अपने असल text में source के visible link के साथ हमेशा cite attribute भी जोड़ें, क्योंकि अकेला cite ज़्यादातर readers को दिखाई नहीं देता।
  • Accepted values:
  • cite — source की ओर इशारा करने वाला एक valid URL (absolute या relative)
  • q, ins और del पर भी valid
  • ब्राउज़र द्वारा display नहीं होता; visible attribution के लिए cite element चाहिए
Warning: क्योंकि cite default रूप से invisible है, सिर्फ इस पर भरोसा करना बिना किसी visible link के, इसका मतलब है कि ज्यादातर readers कभी नहीं देख पाएंगे कि quote वास्तव में कहाँ से आया।

उदाहरण: The cite Attribute on blockquote

markup
<blockquote cite="https://example.com/article">
  This quote's source URL is stored in the cite attribute,
  but it isn't visible to readers.
</blockquote>

q बनाम blockquote: कौन सा उपयोग करें

छोटे quotations के लिए जो किसी sentence या paragraph के अंदर inline flow करते हैं, q element का उपयोग करें — ब्राउज़र स्वचालित रूप से इसके चारों ओर quotation marks जोड़ देते हैं।

लंबे quotations के लिए, जो अपने आप में एक block की तरह अलग खड़े होते हैं, आमतौर पर एक पूरा sentence या उससे ज़्यादा, आसपास के text से visually अलग, blockquote का उपयोग करें।

Note: अगर आपका quote किसी सामान्य sentence के अंदर fit होने जितना छोटा है, तो q का उपयोग करें। अगर उसे अपना अलग paragraph चाहिए, तो blockquote का उपयोग करें।
Warning: q element के अंदर text के चारों ओर manually quotation marks type करने से quote marks दोहरे हो जाते हैं, क्योंकि browsers अपने आप अपने marks जोड़ते हैं।

उदाहरण: q vs blockquote: Which to Use

markup
<p>He mentioned <q>keep it simple</q> in passing.</p>
<blockquote>
  This is a longer quotation that stands apart as its own block,
  separated from the surrounding paragraph text.
</blockquote>
Live Example
Related Topics
{# common_mistakes/chapter_summary/browser_support: on Hindi pages the view already swaps in the hi_ translation fields (or blanks these out if untranslated), so this renders correctly for both languages without a lang_code check here. #}
🔒

Chapter Quiz — Complete all 11 topics to unlock

0/11 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.