HTML अन्य Lists / Description Lists
In this page:
<dl>
<dt>Term</dt>
<dd>Description</dd>
</dl>
एक बुनियादी Description List बनाना
<dl> पूरी list को लपेटता है, <dt> (description term) उस term को mark करता है जिसे define किया जा रहा है, और <dd> (description details) उसकी definition को mark करता है -- ब्राउज़र default रूप से dd content को indent करते हैं, term को उसके explanation से visually अलग करते हुए।
उदाहरण: Creating a Basic Description List
<dl>
<dt>HTML</dt>
<dd>HyperText Markup Language</dd>
</dl>
एक Term के साथ कई Descriptions
किसी term के कई अलग meanings, synonyms, या values होने पर एक single <dt> के बाद एक से ज़्यादा <dd> element आ सकते हैं -- हर dd को उसी term के लिए dt दोहराए बिना एक अलग description के रूप में announce किया जाता है।
उदाहरण: One Term with Multiple Descriptions
<dl>
<dt>Bank</dt>
<dd>A financial institution</dd>
<dd>The edge of a river</dd>
</dl>
एक Description Share करने वाले कई Terms
इसके उलट, एक single <dd> से पहले एक से ज़्यादा <dt> लगातार आ सकते हैं, जिसका मतलब है कि एक description सभी पूर्ववर्ती terms पर समान रूप से लागू होता है -- यह तब उपयोगी है जब कई related terms बिल्कुल एक जैसी definition share करते हों।
उदाहरण: Multiple Terms Sharing One Description
<dl>
<dt>Big</dt>
<dt>Large</dt>
<dd>Of considerable size</dd>
</dl>
Metadata के लिए Description Lists का उपयोग
glossaries से परे, description lists किसी भी label-value pairing के लिए semantically सही choice हैं, जैसे किसी product का metadata (SKU, weight, dimensions) या किसी person की profile details (name, role, location) दिखाना, जहां हर label स्पष्ट रूप से एक specific value से मेल खाता हो।
उदाहरण: Using Description Lists for Metadata
<dl>
<dt>SKU</dt>
<dd>A1234</dd>
<dt>Weight</dt>
<dd>2kg</dd>
</dl>
CSS के साथ Description Lists को Style करना
By default, dd अपने dt से ब्राउज़र के default margin से indent होता है, लेकिन CSS एक description list को two-column grid layout, एक compact inline FAQ format, या underlying term-description semantics को बनाए रखते हुए किसी अन्य visual arrangement में restyle करने की पूरी क्षमता देता है।
उदाहरण: Styling Description Lists with CSS
<style>
dl {
display: grid;
grid-template-columns: 100px 1fr;
}
</style>
<dl>
<dt>Name</dt>
<dd>Alex</dd>
</dl>
Chapter Quiz — Complete all 26 topics to unlock
0/26 topics done
Complete these topics first:
- HTML Favicon
- HTML Page Title
- HTML Tables
- HTML Lists
- HTML Block & Inline
- HTML Comments
- HTML Colors
- HTML CSS
- HTML Links
- HTML Images
- HTML RGB Colors
- HTML HEX Colors
- HTML HSL Colors
- HTML Link Colors
- HTML Link Bookmarks
- HTML Background Images
- HTML Table Borders
- HTML Table Sizes
- HTML Table Headers
- HTML Table Padding & Spacing
- HTML Colspan & Rowspan
- HTML Table Styling
- HTML Table Colgroup
- HTML Unordered Lists
- HTML Ordered Lists
- HTML Other Lists / Description Lists