 |
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

August 31st, 2004, 01:10 PM
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
<STRONG> vs <B> and <EM> vs <I>
what is difference between these corr. tags ?
what we should use ?
|

August 31st, 2004, 01:19 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
What do you want to convey, if anything?
EMphasis and STRONG emphasis obviously signal importance while B is just a text styling tag.
To use EM if you just happen to like bold text is as wrong as to use B when you want to emphasize something.
CSS of course can style EM and STRONG to look like you want.
(o<
//\ =^..^=
|

August 31st, 2004, 05:08 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
|
|
<strong> and <em> add structural meaning to the markup, which can be used in aural browsers to trigger a louder or more emphasized voice for instance. In purely visual browsers most browsers interpret <strong> as bold text and <em> as italic text, although the specifications do not require this. Using these tags for their pre-defined presentation is generally fine since they also add structural meaning and that structural meaning is generally associated with the bold or italic font style. If an effect is purely presentational and there is no extra meaning that you wish to convey you should use CSS instead, either on the containing block or by inserting <span> tags.
<b> and <i> are purely presentational, and are deprecated, so you should avoid them all together.
Regards,
Rich
--
[ http://www.smilingsouls.net]
[ http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail
|

August 31st, 2004, 07:13 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
It's often stated that B is deprecated but I'm afraid that isn't true. That goes for I too.
http://www.w3.org/TR/html401/present....html#h-15.2.1
<b> or <span class="bold">? An extra tag either way you go.
(o<
//\ =^..^=
|

August 31st, 2004, 08:59 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
|
|
Oops, yeah that's true. Sorry about the misinformation. It seems I was just having this same discussion not too long ago too.
A three character tag makes more sense than a 5+ character tag, just depends on your personal preference I suppose. :)
Regards,
Rich
--
[ http://www.smilingsouls.net]
[ http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail
|

August 31st, 2004, 09:05 PM
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
Here's an interesting topic from another forum about this, for anyone who's interested.
http://www.webmasterworld.com/forum21/7095.htm
FWIW,
Snib
<><
|

August 31st, 2004, 09:15 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
|
|
That forum requires subscription/registration.. what does it say?
Regards,
Rich
--
[ http://www.smilingsouls.net]
[ http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail
|

August 31st, 2004, 09:48 PM
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
Sorry about that... I accessed a cache of the page. When the exact same address is accessed through Google, you can see it.
Just click the first result on this page:
http://www.google.com/search?hl=en&i...=Google+Search
Kind of cheating, I guess.... :-(
Snib
<><
|

August 31st, 2004, 10:29 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
|
|
IC
Generally speaking tags like <b> and <i> amount to tag soup, though as meow pointed out either way you're inserting a tag. I think that <span> makes more sense though, given that the style of the bold or italic text isn't limited to those specific styles, whereas <b> and <i> would no longer be appropriate structurally, IMHO. <span> is a generic, dogma-free container that says nothing really about the data it contains, other than any class or id assigned to it, which IMO should be related to the paragraph and not the styles that are being applied, should you decide that some other method of emphasis be appropriate like a background color or other effects. <b> and <i> are purely presentational, and although they aren't yet deprecated, as I thought, the W3C does recommend that CSS be used instead, which suggests to me they probably will become deprecated at some point in the future.
My personal practice is to limit as much presentation as possible to style sheets and leave the markup slim, trim and free from tag soup, which makes skinable designs based on structurally generic markup like those presented at the CSS Zen Garden much more possible.
Regards,
Rich
--
[ http://www.smilingsouls.net]
[ http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail
|

September 1st, 2004, 02:10 PM
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
Rich,
I 100% agree with you. Spans and classes make much more sense. If, for example, you wanted one word to be white, bold, italic, underlined and have a black background, you'd have to use a lot of tags for that, whereas you could just assign a class and reuse the class wherever you want the same formatting.
And as for the aural browsers (all 2 of them :-) ), CSS3 has some voice settings, so hopefully, when aural browsers become common, they will support more CSS of their time than some certain current browsers do of today's CSS :-)
I don't see why the formatting module isn't depreciated already.
Just my $.02.
Snib
<><
|
|
 |