HTML Quotations
In this page:
<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 कर देता है।
- search engines को सीधे source URL से जोड़ने के लिए blockquote के अंदर cite attribute का उपयोग करें।
- Accepted attributes:
- cite — quotation के source का URL
- Global attributes (id, class, lang) भी लागू होते हैं
उदाहरण: The blockquote Element
<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 में लपेट देता है।
- q tag के अंदर manually quotation marks टाइप करने से बचें, क्योंकि ब्राउज़र यह आपके लिए करेगा।
- Accepted attributes:
- cite — quotation के source का URL
- Global attributes (id, class, lang) भी लागू होते हैं
उदाहरण: Short Inline Quotes with q
<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 के रूप में दिखाई देता है।
- अपने visitors के लिए abbreviation का पूरा अर्थ बताने के लिए हमेशा title attribute शामिल करें।
- Accepted attributes:
- title — abbreviation का पूरा विस्तार
- Global attributes (id, class, lang) भी लागू होते हैं
उदाहरण: Defining Abbreviations with abbr
<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 करता है।
उदाहरण: Creative Work Citations with cite
<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 बनाने के लिए बेहद उपयोगी है।
- direction control करने के लिए bdo tag के अंदर हमेशा dir attribute specify करें।
- Accepted attributes:
- dir — ltr | rtl (bdo पर आवश्यक)
- lang — en या ar जैसा language code
उदाहरण: Text Direction Overrides with bdo
<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 देता है।
- अपने असल 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 चाहिए
उदाहरण: The cite Attribute on blockquote
<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 का उपयोग करें।
उदाहरण: q vs blockquote: Which to Use
<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>
Chapter Quiz — Complete all 11 topics to unlock
0/11 topics done
Complete these topics first: