...

View Full Version : quick question



newmand2
02-02-2004, 10:35 PM
why have read that <strong> tags are better than a <b>? dont they act the same way? same for <em> and <i> etc

liorean
02-02-2004, 10:43 PM
Well, the reason is one of semantics. The default style is the same, but the meaning is different, and you should mark your document up according to the meaning, not the style. Em means emphasis, strong means strong emphasis. B means bold type, i means italics. Thus, em and strong have meaning aside the visual presentation, while b and i haven't.

oracleguy
02-03-2004, 12:49 AM
Also make sure you read our posting guidelines (http://www.codingforums.com/postguide.htm) on naming threads appropriately.

Something like "Why is <strong> better than <b>?" would be better than "quick question." It makes it easier when people search the forum or just plain look at new threads to find ones they can answer.

Tails
02-03-2004, 04:08 AM
I've never seen <strong> used on a page., but I learned it at the same time as the <b> tag. To me, it's more or less just an alias. It's beyond me why <strong> wasn't a target for being depricated when more widely used tags were.

mindlessLemming
02-03-2004, 04:15 AM
It's beyond me why <strong> wasn't a target for being depricated when more widely used tags were.

Read the first response to this post.
Semantics are why meaningless and/or presentation tags are being deprecated.
Did you even read the whole thread before posting? :confused:

Tails
02-03-2004, 04:17 AM
Originally posted by mindlessLemming
Read the first response to this post.
Semantics are why meaningless and/or presentation tags are being deprecated.
Did you even read the whole thread before posting? :confused:

Yes, I did. But the result is still the same. No browser implements <b> and <strong> differently. One would have to search the source just to know if it was <b> or <strong>. Most people would have better things to do and it's easy to rely on something less irritating.

mindlessLemming
02-03-2004, 04:24 AM
The one case where they would differ is when a user is accessing your page via a screen reader. The screen reader's voice would place strong emphasis on the words within a <strong> tag, but would not pronounce words within a <b> tag any differently.
Or as is my understanding, tell me if I'm wrong here guys :D

Tails
02-03-2004, 04:26 AM
Hmm, I never thought of that (I have no experience with mics and voice stuff). It may also be covered in CSS2 with the @media stuff.

rmedek
02-03-2004, 05:38 AM
Also, some people prefer to emphasize certain words with bold text, other prefer to empahzise certain words with italics. And some, like me, change their mind all the time. But if I mark up a page semantically, then I would emphasize <em>certain words</em>.

em {font-weight (or style):whatever I'm in the mood for}

-Rich

newmand2
02-03-2004, 07:26 AM
so lets say your title is in bold... the reader will read it wierd? like with emphasis? so then there its best to use <b>

ronaldb66
02-03-2004, 08:40 AM
No, your title (I reckon you mean something of a header) would be in an hx (h1, h2, etc.) element, and the user agent (whichever that may be) can decide on this basis how the content should be expressed. Stop thinking looks, start thinking meaning; CSS can control what it looks/sounds/feels like (yes, there are braille terminals as well...).

liorean
02-03-2004, 09:01 AM
Ok, let me explain:
Strong and em tell us something about the nature oif the content. B and i doesn't. What default style the browser applies to them is of no importance whatsoever, that style can be changed with a line of css. No, what matters is the meaning it implies for the contents. That's the reason you should use p for paragraphs instead of div. That's the reason you should use strong for text you want to emphasise instead of b. That's why you should use tables only for tabular data, not as a layout element. That's why you should use lists for linklists and page menus instead of sequences of a separated by br, or nested divs. That's why you shouldn't use the font tag.

- In one word: Semantics.

newmand2
02-03-2004, 09:30 AM
right, got it ;) and yes i did mean header

ronaldb66
02-03-2004, 12:05 PM
got it
Great! :thumbsup: Remember that however harsh we may be sometimes, we always mean the best by you! :D

mindlessLemming
02-03-2004, 12:16 PM
Originally posted by liorean
Ok, let me explain:
Strong and em tell us something about the nature oif the content. B and i doesn't. What default style the browser applies to them is of no importance whatsoever, that style can be changed with a line of css. No, what matters is the meaning it implies for the contents. That's the reason you should use p for paragraphs instead of div. That's the reason you should use strong for text you want to emphasise instead of b. That's why you should use tables only for tabular data, not as a layout element. That's why you should use lists for linklists and page menus instead of sequences of a separated by br, or nested divs. That's why you shouldn't use the font tag.

- In one word: Semantics.

This should be copied into a sticky or something, so we can just link back to it in the future instead many different people trying to explain it.

newmand2
02-03-2004, 03:42 PM
Originally posted by ronaldb66
Great! :thumbsup: Remember that however harsh we may be sometimes, we always mean the best by you! :D

Kinda sounds like my parents!


Originally said by my parents
we only do it because we care

oracleguy
02-03-2004, 07:09 PM
Originally posted by mindlessLemming
This should be copied into a sticky or something, so we can just link back to it in the future instead many different people trying to explain it.

I agree but George has rules on how many stickys we can have in each forum, the most we can have is 3-4.

Eskimo
02-03-2004, 09:01 PM
It might not go sticky, he wins the terse award again!

That goes in my quote box.

mindlessLemming
02-03-2004, 11:34 PM
Originally posted by oracleguy
I agree but George has rules on how many stickys we can have in each forum, the most we can have is 3-4.
I didn't mean sticky this thread, just post lioreans explaination at the bottom of an existing sticky. But having looked around, I can't find any that would be appropriate :(

Andrew



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum