• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

function of "em"

 
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the expected behavior of an "em" tag in a HTML? When should I use it?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is the sort of thing that is very easy to look up.
 
author
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"behavior" may not be the right word. The intended meaning of the <blockquote>code:
<pre name="code" class="core">em</pre>
</blockquote> element is that its contents are emphasized. How emphasis is indicated depends on the browser. In most visual browsers it's italicized, but in audio browsers it can simply be spoken louder or in a different tone.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"em" is also a step below "strong". It's not just the new italic.
 
Sheriff
Posts: 1367
18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Kenneth Love:
"em" is also a step below "strong". It's not just the new italic.



This is a good point. If you ever create a website about plants, the latin names should be italicized... but not emphasized.

Though I am not a linguist, I suspect that there are similar conventions for dictionary entries and the like.
 
Elliotte Rusty Harold
author
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Very true. Too many developers simply replace all the <i> tags with <em> and think they've done their job. Latin names are, in fact specifically discussed in the book in the section on "Replace <i> with <em>". I recommend using a span element with an appropriate class in this case. E.g.



Then you can define a CSS rule that italicizes all the species. However for quick and dirty work, you're better off using <i> here than <em>.
[ July 18, 2008: Message edited by: Elliotte Rusty Harold ]
 
Did you ever grow anything in the garden of your mind? - Fred Rogers. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic