realervz
realervz

Reputation: 13

Are there any differences between this 4 html elements?

Can I clarify that these 4 elements below actually do the same job by rendering the text in italic and there is no difference in using each of them except to differentiate the type of content?

<i>
<em>
<address>
<cite>

Upvotes: 1

Views: 50

Answers (3)

AnkRaw
AnkRaw

Reputation: 217

Yes, they all have the same default style which sets the content to italic. And yes, a particular tag will be chosen according to the content.

Reference: For more information refer to below links: What is the difference between <cite>, <em>, and <i> tags of HTML? What's the difference between <b> and <strong>, <i> and <em>?

Upvotes: 0

Peter Nielsen
Peter Nielsen

Reputation: 261

Yes, you can. Do this:

<html>
    <body>
        <i>italic text</i>
        <em>italic text</em>
        <address>italic text</address>
        <cite>italic text</cite>
    </body>
</html>

Put this into a file called <filename>.html and open it in a browser (e.g. Chrome). If the text looks the same, it looks the same! enter image description here

As you can see, the <i> and <em> elements do not make a newline automatically, but otherwise there is no difference. If you'd like to change the styles yourself, you can create a css file.

Upvotes: 1

muhkanda
muhkanda

Reputation: 349

You right, these 4 Elements basically renders all text or content as italic, the different off all these element just at the content.

  • The <i> tag defines a part of text in an alternate voice or mood.
  • The <em> tag is used to define emphasized text.
  • The <address> tag defines the contact information for the author/owner of a document or an article.
  • The <cite> tag defines the title of a creative work (e.g. a book, a poem, a song, a movie, a painting, a sculpture, etc.).

Upvotes: 0

Related Questions