tags:

views:

301

answers:

5
+3  Q: 

<strong> vs <em>?

What is the difference? both emphasize the text . <em> shows text as italics, is this the only difference?

A: 

<strong> is bold. <em> is italics.

Tyler Smith
It's not true. Although most browsers do that, but it is not standarized in any way (HTML spec does not specify visual styles for strong and em), and can be changed with CSS.
el.pescado
A: 

<strong> is a tag you'd put around a sentence or phrase to indicate that "this is more important than the surrounding text".

<em> is generally used to indicate the stress of a word within a sentence.

E.g. In spite of what some might say, there is a semantic difference between the elements.

Edit: For a clear distinction between stress emphasis and importance, and more examples, see the HTML 5 draft. http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-em-element

Alohci
There is nothing in the spec about one applying to words and the other to phrases.
David Dorward
The words and phrases distinction is incidental to my answer.
Alohci
+4  A: 

EM indicates emphasis.

STRONG: Indicates stronger emphasis.

http://www.w3.org/TR/html4/struct/text.html#h-9.2.1

David Dorward
emphasis for what ?
metal-gear-solid
of text content surrounded by those tags
macbirdie
is the difference only related to screen reader?
metal-gear-solid
It's a semantic thing. You decide that that bit of text needs more emphasis, so you tag it with <em>.
Oded
I found info on wikipedia http://en.wikipedia.org/wiki/Emphasis_%28typography%29 but it only say it's different styled of text
metal-gear-solid
That article is talking about typography, not HTML. Don't get hung up on the way that it looks (by default, in most graphical browsers, before CSS is applied)
David Dorward
I like to think of it as the difference between "*You* didn't go to the store" and "**Do not** go near the buzzsaw". They both have emphasis, but one is quite a bit stronger.
Chuck
You need to check the HTML5 draft, which more clearly indicates the distinction between stress emphasis and importance.
Alohci
+13  A: 

Yeah, the definition of what ‘strong emphasis’ is compared to just ‘emphasis’ is pretty woolly. The only standard definition would be “it's emphasised, but more!!”.

Personally I use <em> for normal emphasis where you'd read the emphasised word in a different tone of voice, and <strong> for that thing where you take key words and phrases to pick them out of the text to help people skimming the text pick out the subjects.

This isn't a standard interpretation, but it makes some sense and rendered appropriately by the default italic/bold styles. Whatever you do, be consistent.

bobince
u wrote "....different tone of voice" it means the differencce is only related to screen reader not for screens. Should we style <strong> as bold text and <em> as italic text, always?
metal-gear-solid
Nah, style them how you like, but the usage of bold for skimwords (as they stand out) and italic for emphasised words (which don't) is pretty commonplace. As for tone of voice what I really mean is the tone of voice you'd read it in out loud (or in your head), rather than specifically anything to do with screen readers (though they could do it too).
bobince
A: 

Note that the difference is going to change:

In HTML 4.01, the <strong> tag defined strong emphasized text, but in HTML 5 it defines important text.

Doesn't make the issue any clearer, does it?

Michael Borgwardt
Not much. But the examples in the HTML 5 draft make the distinction clearer.
Alohci
Might change. It is still a draft.
David Dorward
@David. True enough. But if i'm wrong, then so is Hixie.
Alohci
Hixie is not the Pope.
David Dorward