HTML <em> <strong> <dfn> <code> <samp> <kbd><var> <cite> tags
Definition and usage
The following elements are phrase elements. Although the text defined by these tags often presents a special style, in fact, these tags all have precise semantics.
We are not against using them, but if you only use these tags to achieve a certain visual effect, we recommend using style sheets, which will achieve a more rich effect.
<em> | Define text as emphasized content. |
<strong> | Define text as toneStrongerof the emphasized content. |
<dfn> | Define a definition item. |
<code> | Define computer code text. |
<samp> | Define sample text. |
<kbd> | Define keyboard text. It indicates that the text is entered from the keyboard. It is often used in documents or manuals related to computers. |
<var> | Define variables. You can use this tag in conjunction with the <pre> and <code> tags. |
<cite> | Define citations. You can use this tag to define citations of references, such as book or magazine titles. |
Differences Between HTML and XHTML
None
Standard Attributes
id, class, title, style, dir, lang, xml:lang
For a full description, please visit the standard attributes.
Event Attributes
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup
For a full description, please visit the event attributes.
HTML Text Formatting Example
- Text Formatting
- This example demonstrates how to format text within an HTML file.
- Computer Output Tags
- This example demonstrates the display effects of different 'computer output' tags.