Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: <b> versus <strong>

  1. #1
    Join Date
    Jan 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default <b> versus <strong>

    Hi,
    Both the above appear to do the same thing to text on a web page.
    Have I misunderstood their use?
    Do Search engines view them differently?
    Thanks

  2. #2
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Well, there's no difference that I know of, except for the fact the <b></b> takes up less time to type. Try running it in the validator see what it has to say.
    - Mike

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Spambot.

    The answer is that <strong> is semantic, while <b> is visual. <b> just says that the text should be bold, while not giving any reason why that should be the case; <strong> says that this text is intended to be given emphasis. How this is accomplished is up to the user agent, although the tradition has been to make it bold.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I think strong will win if it can stand being stung by the b. Kidding aside, the modern method is to style this in your stylesheet:

    Code:
    .bold {
    font-weight:bold;
    }
    and use it in your markup like:

    HTML Code:
    <span class="bold">I'm Bold!</span>
    This seems like extra work and is for such a single and simple style. However, the way most web pages are designed, much effort can be saved and much modularity can be gained if all style resides in the stylesheet. Multiple styles can be assigned to a class that can be reused over and over in the document and, even (with the use of an external stylesheet) in several documents. If this class' style ever needs to be changed, it can then be changed across the entire site in just one location in just one file.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    the modern method is
    It depends as to why the text is being made bold. If it's in order to emphasise the text, <strong> is preferable to <span>. If it's a header, <h1> (or <h2>, or <h3>, or so on) should be used. <span> and <div> are both "generic" elements, that should only be used when there's nothing with semantics that match your intended purpose. Style can be applied to the header or the <strong>, if its being bold doesn't suit one's purpose.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    To answer the original question, there is no difference between <strong> and <b>.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Huh? I just explained the difference: <b> is presentational while <strong> is semantic.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    But, it makes no difference which you use.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. #9
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    It leaves you with semantic markup that can be better understood by both humans and digital parsers. This page explains some of the reasons to use semantic markup and some examples of where it's possible, as well as some where it isn't; however, note that it erroneously recommends using <b> and <i> for those cases where there is nothing semantically closer to the meaning of the text. These days we would, as you said, use a <span> and CSS for those cases.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  10. #10
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I think I will choose to concede this one although, I agree with the author of the article. Why give people the choice when it is more likely that they will choose incorrectly or simply not use it at all due to there being too many choices available?

    I didn't even know about dfn and some of those other tags.

    Still makes no difference in how it looks (b vs. strong).
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •