Dave Taylor answers free tech support questions about a wide variety of business and technical topics, including blogging, iphone help, ipod help, AdSense, MySpace, Sony PSP help, Mp3 players, Windows XP, Windows Vista, Linux, SEO, Mac OS X, Facebook, Twitter and LinkedIn.

What HTML tag should I use, <b> or <strong>?

Just a quick question: as I'm figuring out HTML, I've learned that "<b></b>" will make the inner text bold, but why are we seeing "<strong>" being used these days? Is there a difference?


Dave's Answer:

While you would think that something so rudimentary as the markup language for Web pages wouldn't be a place where you'd find great controversy, in fact there are two different quite fervent camps in site design that are represented in this debate. What we're talking about is whether markup should be functional or whether it should be presentation-based.

If you were on the functional side, you would say that when you're writing content for online publication, you want to simply note how that element relates to the content overall. So "<cite>" for citations, "<a>" for anchor text (hypertext links), and so on. How it's rendered, how the tool that the reader is using to view your content, is up to their tool's preferences. Some users might prefer citations in yellow with a dark blue background, while others might want to simply have it underlined: it's "up to the browser".

In fact, when I teach web design classes, that's our mantra, because however much you tweak things, the user's tools, preferences and settings can and will doubtless change how they see your material.

Now, on the presentation side, designers would point out that while all of this is well and good with something like a citation, there's such a difference between bold and italic in terms of how you read and process the information on the screen that it's of great importance that the content producer have greater control over how it's displayed.

While functional designers would use "<strong>" and "<em>" for words that should be emphasized or "stronger", a presentation designer would eschew it completely and use "<b>" for bold and "<i>" for italics.

Which is right? Well, it's hard to say. If you like having more control over the presentation of your material, then the presentation approach is going to be a better match. If you want to focus on your content and let the reader (or, more accurately, their reading tool) do the work, then a more functional approach may be for you.

As it turns out, this is somewhat of a moot point given the rise of Cascading Style Sheets (or CSS). CSS brings a far greater level of sophistication to presentation markup and while it initially seems a lot more complicated, the greater power makes it well worth learning.

In CSS, however, the markup "<b>bold!</b>" changes rather dramatically to "<span style='font-weight:bold;'>bold!</span>". A lot more complex, but as you might guess, there are dozens of different transformations you can apply to text with CSS elements -- like wrapping the text with a thin border -- that just aren't even an option with HTML.

While I am a big fan of CSS and use it with astonishing frequency for even the most simple tasks, it's definitely more complicated and, more of a problem, many Web sites let you use rudimentary HTML where you can't use CSS. A great example is that most online forums and blogs allow "<b>" notation in your comments to let you emphasize words, but very few allow "<span>" to let you use the full power of CSS to really pretty up your prose.

Therefore it does behoove you to learn at least the dozen basic HTML markup tags for just those situations. In fact, I have a brief article on my Web site that gives you just this list, with a helpful explanation of each tag: Essential HTML tags bloggers need to know.

My recommendation for when you must use HTML? Use the presentation-based approach, not the functional approach.

In a word, "Go <b> go!"



Help others find this article at Del.icio.us, Digg, Netscape, Reddit, and Stumble Upon    
Categorized: HTML and CSS   (Article 8447)
Tagged: , , ,
Previous: Review: BlackBerry Curve 8310
Next: What is eBay auction fever?

Subscribe!

Never miss another useful Q&A article again! Subscribe to AskDaveTaylor with Google Reader.

Comments

I generally prefer using tag in my posts and even in the codes of static pages.

Posted by: Amit Bhawani at August 22, 2008 2:52 AM

Dave, do you know if search engine logic gives higher weight to terms within EM tags than I or B tags?

Posted by: Matt at October 14, 2008 10:17 AM

That was an informative article - it provides both sides of the debate nicely.
However, I was surprised by your concluding line - "Use the presentation-based approach, not the functional approach". This is a recipe for disaster. Despite all of CSS's complexity, the one thing that makes it worthwhile is the flexibility that it affords the web designer. Changes to a CSS-designed site can easily be made. However, design changes to a site full of presentational markup is something one wouldn't wish on one's worst enemies :)

Posted by: Chetan Crasta at October 30, 2008 3:58 AM


I have a lot to say, but ...
Starbucks coffee cup I have a lot to say, and questions of my own for that matter, but most of all I'd like to say thank you for all your efforts on this Web site by buying you a chai!

I do have a comment, now that you mention it!









Remember personal info?


Please note that I will never send you any unsolicited commercial email. Ever.

While I'm at it, please note that by submitting a question or comment you're agreeing to my terms of service, which are: you relinquish any subsequent rights of ownership to your material by submitting it on this site.









Uniblue: Free Virus Scan

Search
Find just the answers you seek from among our 1700+ free tech support articles by using our Lijit search engine.


Member of the B5Media Network

Help!





Subscribe to
Ask Dave Taylor!

Add to Google Reader
Add to My Yahoo!
Subscribe in NewsGator Online

RDF   XML

Free Updates!
Sign up and get free weekly updates and special offers on books, seminars, workshops and more.


Recent Entries
Join the List!
Join my author info mailing list, where you'll learn about my upcoming books, speaking gigs, and more!


Book Links
© 2002 - 2008 by Dave Taylor. All Rights Reserved.

Note: This web site is for the purpose of disseminating information for educational purposes, free of charge, for the benefit of all visitors. We take great care to provide quality information. However, we do not guarantee, and accept no legal liability whatsoever arising from or connected to, the accuracy, reliability, currency or completeness of any material contained on this web site or on any linked site.

[whiteboard marker tray]