HTML <q> टैग क्या है?
HTML में <q> टैग का उपयोग एक छोटे उद्धरण (short quotation) को निर्दिष्ट करने के लिए किया जाता है। <q> टैग के अंदर सेट टेक्स्ट के चारों ओर स्वचालित रूप से उद्धरण चिह्न (quotation marks) डाले जाते हैं।
एट्रिब्यूट
- cite: उद्धरण के स्रोत URL को सेट करता है।
उदाहरण
<!DOCTYPE html> <html> <body> <h2>Thoughts</h2> <p>Warren Buffett quoted, <q>It's better to hang out with people better than you. Pick out associates whose behavior is better than yours and you'll drift in that direction. </q></p> <p>Bill Gates quoted, <q>Your most unhappy customers are your greatest source of learning.</q></p> </body> </html>
आउटपुट
उद्धरण चिह्न स्वचालित रूप से जुड़ जाएंगे:

कोड विश्लेषण
उपरोक्त उदाहरण में, हमने <q> टैग का उपयोग करके HTML में कुछ उद्धरण सेट किए हैं:
<p>Warren Buffett quoted, <q>It's better to hang out with people better than you. Pick out associates whose behavior is better than yours and you'll drift in that direction. </q>
जैसा कि आप ऊपर देख सकते हैं, हमने <q> टैग का उपयोग करके उद्धरण सेट किया है। आउटपुट में <q> टैग स्वचालित रूप से उद्धरण के चारों ओर छोटे उद्धरण चिह्न जोड़ता है।
<q> बनाम <blockquote>
| एलिमेंट | उपयोग | रेंडरिंग |
|---|---|---|
| <q> | इनलाइन, छोटे उद्धरण | स्वचालित उद्धरण चिह्न |
| <blockquote> | ब्लॉक-स्तर, लंबे उद्धरण | इंडेंटेड ब्लॉक, कोई स्वचालित उद्धरण नहीं |
CSS नियंत्रण
उद्धरण चिह्न CSS से अनुकूलित किए जा सकते हैं:
q { quotes: "«" "»" "‹" "›"; }