पिछले topic में हमने कुछ regular formatting elements के बारे में जाना, लेकिन इस topic में हम कुछ special formatting elements के बारे में जानेंगे |
निचे कुछ special elements दिए गए है |
Special Formatting Elements | Meaning |
---|---|
<address> | Address text |
<abbr> | Abbreviation text |
<acronym> | Acronym text |
<bdo> | Bi-Directional Override text / Text Direction |
<dfn> | Definition text |
<blockquote> | Blockquote text |
<q> | Quoted text |
<kbd> | Keyboard text |
<tt> | Teletype/Monospace text |
<samp> | Sample Output text |
<var> | Variable text |
<code> | Computer Code text |
<pre> | Preformatted text |
Address(<address>) Element in HTML
Abbreviation(<abbr>) Element in HTML
text abbreviation <abbr> और </abbr> के बीच में दिया जाता है | अगर abbreviation होता है तो उसका पूरा description title attribute के अन्दर दिया जाता है | इसके लिए 'title' ये एकमेव attribute होता है | title attribute ये tooltip होती है जो उस text पर mouse hover करने पर display होता है |
<abbr title="World Wide Web">WWW</abbr>
Acronym(<acronym>) Element in HTML
Same as <abbr> element. ये tag HTML5 से हटा दिया गया है | <abbr> tag के description को follow करे |
<acronym title="Hypertext Preprocessor">PHP</acronym>
Bi-Directional Override(<bdo>) Element in HTML
<bdo> ये element दिए हुए text की direction को override करता है |
<bdo dir="rtl"> The direction of the text has changed from right to left. </bdo>
Defintion(<dfn>) Element in HTML
<dfn> element में special शब्द या परिभाषा के विशिष्ट शब्द को दिया जाता है | ये definition tag; italic text जैसे होता है |
<p><dfn>HTML</dfn> stands for hypertext markup language.<p>
HTML stands for hypertext markup language.
Blockquote(<blockquote>) Element in HTML
<blockquote> element में किसी विशिष्ट topic का content दर्शाने के लिए इस्तेमाल किया जाता है |
<blockquote>Current text is in blockquote element</blockquote>
Current text is in blockquote element
Quoted(<q>) Element in HTML
<q> element ये उसके अन्दर दिए जानेवाले content को quotation mark("") देता है |
<q>The current text in the output will appear in double quoted</q>
The current text in the output will appear in double quoted
Keyboard(<kbd>) Element in HTML
<kbd> element ये keyboard द्वारा दिए हुए input का वर्णन करता है | इस element पर monospaced font होता है |
<kbd>Keyboard text</kbd>
Teletype/Monospaced(<bdo>) Element in HTML
<tt> element ये <kbd> element के जैसा ही है | अब इस element को हटा दिया गया है | ये अभी भी सभी browser पर execute होता है, लेकिन ये किसी भी वक्त पर browser से हटा दिया जा सकता है | इसका इस्तेमाल ना करे |
<tt>Teletype text</tt>
Sample(<samp>) Element in HTML
<samp> element ये program के sample output को दर्शाता है |
Output is <samp>Hello World</samp>
Variable(<var>) Element in HTML
<var> element ये program के variable का वर्णन करता है |
var <var>var_name</var> = "Hello World";
Computer Code(<code>) Element in HTML
<code> element ये computer code का वर्णन करता है |
<code>Computer Code</code>
Computer Code
Preformatted(<pre>) Element in HTML
<pre> element ये preformatted text का वर्णन करता है | इस element पर दिए हुए text का font monospaced होता है | इस element पर एक साथ दिए हुए multiple spaces,newline(Enter) आप जैसे text type करते है वैसे ही display होता है |
<pre> preformatted text preformatted text <b>preformatted text</b> preformatted text </pre>
preformatted text preformatted text preformatted text preformatted text
Default CSS for Special Formatting Elements in HTML
formatting elements में जब कोई text दिया जाता है तब वो text कुछ अलग-अलग तरीके से display होता है | उसका कारण होता है उसे दी हुई CSS(Cascading Style Sheet) | इन elements को पहले से ही default css दी गयी है, इसके कारण वो अलग-अलग प्रकार में display होते है |
Special Formatting Elements | Meaning | Default CSS |
---|---|---|
<address> | Address text | address{display: block; font-style: italic;} |
<abbr> | Abbreviation text | - |
<acronym> | Acronym text | - |
<bdo> | Bi-Directional Override text / Text Direction | bdo{unicode-bidi: bidi-override;} |
<dfn> | Definition text | dfn{font-style: italic;} |
<blockquote> | Blockquote text | blockquote{display: block; margin-top: 1em; margin-bottom: 1em; margin-left: 40px; margin-right: 40px;} |
<q> | Quoted text | q {display: inline;} q:before {content: open-quote;} q:after{content: close-quote;} |
<kbd> | Keyboard text | kbd{font-family: monospace;} |
<tt> | Teletype/Monospace text | tt{font-family: monospace;} |
<samp> | Sample Output text | samp{font-family: monospace;} |
<var> | Variable text | var{font-style: italic;} |
<code> | Computer Code text | code{font-family: monospace;} |
<pre> | Preformatted text | pre{display: block; font-family: monospace; white-space: pre; margin: 1em 0;} |