What is the difference between <cite>, <em>, and <i>
tags of HTML ?
All render same default style in most of browsers.
Is there any meaning behind these tags ?
Can anyone give example about where these tags can be used ?
By default, the visual result is the same. The main difference between these two tag is that the <em> tag semantically emphasizes on the important word or section of words while <i> tag is just offset text conventionally styled in italic to show alternative mood or voice.
<cite> is used when the content is some kind of articles. <em> stands for "emphasis" is used to insists the meaning. <i> stands for "italic", making the text italic.
<em>: The Emphasis element. The <em> HTML element marks text that has stress emphasis. The <em> element can be nested, with each level of nesting indicating a greater degree of emphasis.
Definition and Usage The <em> tag is used to define emphasized text. The content inside is typically displayed in italic. A screen reader will pronounce the words in <em> with an emphasis, using verbal stress.
<cite>
is used for citations (either of resources or of their authors). They are commonly used together with <q>
or <blockquote>
(both used for quotations).
<em>
means text emphasis (in a paragraph or some other text content).
In legacy HTML, <i>
used to mean italicized text. In HTML5, <i>
has been repurposed into something else entirely. (Note that this was not true at the time this answer was originally written.)
The only thing these three elements have in common is that all three of them are typically set in italics. In other words, the fact that they all have the same default style is mere coincidence.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With