Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 31st, 2004, 01:10 PM
Friend of Wrox
 
Join Date: Mar 2004
Location: Bhopal, MP, India.
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default <STRONG> vs <B> and <EM> vs <I>

what is difference between these corr. tags ?
what we should use ?
__________________
`~@#\^%&*/\.<.\/-|+|_!:;..=?>
PHP, SEO | anshul shrivastava | mediasworks.org | FB
Reply With Quote
  #2 (permalink)  
Old August 31st, 2004, 01:19 PM
Friend of Wrox
Points: 1,315, Level: 14
Points: 1,315, Level: 14 Points: 1,315, Level: 14 Points: 1,315, Level: 14
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , .
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

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<
//\ =^..^=
Reply With Quote
  #3 (permalink)  
Old August 31st, 2004, 05:08 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

<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
Reply With Quote
  #4 (permalink)  
Old August 31st, 2004, 07:13 PM
Friend of Wrox
Points: 1,315, Level: 14
Points: 1,315, Level: 14 Points: 1,315, Level: 14 Points: 1,315, Level: 14
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , .
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

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<
//\ =^..^=
Reply With Quote
  #5 (permalink)  
Old August 31st, 2004, 08:59 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

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
Reply With Quote
  #6 (permalink)  
Old August 31st, 2004, 09:05 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Here's an interesting topic from another forum about this, for anyone who's interested.

http://www.webmasterworld.com/forum21/7095.htm

FWIW,

Snib

<><
Reply With Quote
  #7 (permalink)  
Old August 31st, 2004, 09:15 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

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
Reply With Quote
  #8 (permalink)  
Old August 31st, 2004, 09:48 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

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

<><
Reply With Quote
  #9 (permalink)  
Old August 31st, 2004, 10:29 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

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
Reply With Quote
  #10 (permalink)  
Old September 1st, 2004, 02:10 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

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

<><
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch 8: <asp:image> inside <a> & ext.CSS (pg. 274) epc BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 July 12th, 2008 04:37 AM
<style> tags in a <body> vs. <div> bcat BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 March 27th, 2005 08:50 AM
<marquee><b>About CHAT App. in PHP4</b></marquee> Ramkrishna PHP How-To 1 September 11th, 2004 07:01 AM
a problem in book<<beginning asp.net using vb>> luoware ASP.NET 1.0 and 1.1 Basics 3 December 8th, 2003 09:32 PM
<<ASP.NET Security>>,download files in chapter 8 alaix All Other Wrox Books 1 July 24th, 2003 10:29 AM



All times are GMT -4. The time now is 03:20 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.