views:

105

answers:

3

Is it only for screen reader software? because browser renders both type of tags semantic and presentational in same manner.

For example:

for browser for us and for css <strong> and <b> is same. what is the purpose to semantic tag over presentational tag.

is it for screen readers only or it's for better management of code?

if it's for developer strong and b both can produce same result on browser.

+1  A: 

<strong> and <b> is a poor example in this case, as they are just historically used in a wrong notion. A lot of people started marking everything bold with <strong>, thus destroying the original intent. My phone browser does not make <strong> bold for instance (although the standards suggests making it bolder on screen).

The idea behind semantic tags is to provide some description about the content. So <strong> tag for menu items does not make any sense, while it makes sense to use it to mark part of a sentence as if it was pronounced louder.

With HTML5 semantic tags make a lot more sense, because the content part of the page is clearly outlined, and every tag inside the content is a usable meta data. Search engines are already good at this, but everyone else isn't.

I suggest reading about the whole concept of Semantic Web.

HeavyWave
"The idea behind semantic tags is to provide some description about the content." agree but what is benefit of this, for Browser and user and developer. I know it's beneficial for screen readers.
metal-gear-solid
Right now there is no benefit, but in the future it will theoretically allow browsers and other consumers to make intelligent guesses about the content.
HeavyWave
+1  A: 

Semantic markup allows scripts to understand context. This may be beneficial for screen reader software, but it will also be beneficial for Google and other search bots.

According to HTML specs, <strong> and <em> communicate emphasis, whereas <b> and <i> simply mean "display bold" and "display italic". <b> and <i> should be used in instances where emphasis is specifically not desired. For example, when italicizing a book title.

When search bots are trying to gain semantic understanding of content, it is reasonable to assume they give greater preference to semantic tags.

kingjeffrey
yes but browsers renders `<em>` and `<i>` in same manner.
metal-gear-solid
Yes, the render the same. The question was "What is the logic behind to use Semantic meaningful markup?" not "Do they reneder the same?"
kingjeffrey
yes but rendering point is also related to my question. yes but not was in title.
metal-gear-solid
There is no guarantee that they are rendered the same in every browser. You should use reset css, than you will see that it is you who defines how they are rendered, not the browser.
HeavyWave
@metal-gear-solid Are you looking for an answer, or trying to make a case that it doesn't really matter? You have stated repeatedly that they display the same, and no one disputes that. You asked if there was any benefit other than screen readers, I pointed out search engine optimization. You said "yes but browsers renders <em> and <i> in same manner." What?
kingjeffrey
@metal-gear-solid Do you recycle your questions? http://stackoverflow.com/questions/2243074/is-it-ok-to-use-strong-in-place-of-b-blindly
kingjeffrey
A: 

In theory, an audio page reader could read <strong> text in a different, slower, more emphasized tone of voice. It wouldn't do that for just <b> because that's only a typographical hint for graphical presentation. A terminal-based browser could use underlining to reproduce <strong> as an alternative to bold if it's not an available effect on the terminal, where is principle it wouldn't make sense to do that for typographical <b>. A search engine could give more importance to <strong>​ed words.

In practice, I don't think any of these examples actually happen — partly, as HeavyWave says, because decades of poor-quality markup have erased any difference between them that could usefully be drawn — but it demonstrates the philosophical difference.

bobince
ur answer is also denote it's mainly beneficial for screen reader softwares. but this is also not has much benefit really read this http://www.paciellogroup.com/blog/?p=41
metal-gear-solid
I'm well aware of that. (“In practice...”)
bobince