SitePoint Sponsor

User Tag List

Results 1 to 15 of 15
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2009
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question <strong> vs <b>?

    I am new to web designing. Struggling with basics.
    Does the two tags <strong> and <b> do the same thing?
    What is the difference between these?
    Also does changing uppercase to lowercase of an html doc change it to xhtml?

  2. #2
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    <strong> and <b> are for different things, <strong> is for adding emphasis on text content and <b> is for making text content bold.

    http://reference.sitepoint.com/html/strong
    http://reference.sitepoint.com/html/b

    No, using lowercase markup does not make it XHTML. This is determined by the doctype being used as well as the way the markup is written. One of the requirements of XHTML is that the markup be written in lowercase.

    Though it should be noted that you cannot use real XHTML, as IE does not support it. Thus you have to serve it as text/html making it HTML, so you might as well stick to declaring the doc as HTML 4.01.

    I am sure smarter members than I can elaborate more accurately than I can!

  3. #3
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,868
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    The only time the <b> tag is semantically correct is where you are discussing typographics and specifically mention text being displayed in bold or where you are discussing some other field where bold text has a specific meaning to those involved in that field without your having to explain to readers what the bold means.

    <strong> may display as bold text in some browsers as its semantic meaning is to apply strong emphasis to the content and some browsers do that by making the content bold. Browsers do not have to do that - you could set your browser to apply strong emphasis by making the content red instead of bold and screen readers apply the emphasis in the way they say the content.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  4. #4
    SitePoint Zealot zainabSULE's Avatar
    Join Date
    Apr 2009
    Location
    NG
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    they are kinda the same.... just browsers rendering differently.

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,868
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by zainabSULE View Post
    they are kinda the same.... just browsers rendering differently.
    No they are not - they have entirely different uses and meanings - all they have in common is that browsers often render them the same.

    You have it completely backwards.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  6. #6
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,072
    Mentioned
    103 Post(s)
    Tagged
    0 Thread(s)
    Isn't the use of <b> depreciated anyway?
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  7. #7
    Resident curmudgeon bronze trophy gary.turner's Avatar
    Join Date
    Jan 2009
    Location
    Dallas
    Posts
    990
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SpacePhoenix View Post
    Isn't the use of <b> depreciated anyway?
    No. Nor will it be deprecated/obsoleted in html5. There was a long discussion on the html5 WG mail list on this. The b element has context derived meaning due to typographic convention, as does the i element.

    cheers,

    gary
    Anyone can build a usable website. It takes a graphic
    designer to make it slow, confusing, and painful to use.

    Simple minded html & css demos and tutorials

  8. #8
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by zainabSULE View Post
    they are kinda the same.... just browsers rendering differently.
    Yes ... in about the same way that oranges and wingnuts are kinda the same.
    Birnam wood is come to Dunsinane

  9. #9
    SitePoint Enthusiast
    Join Date
    Sep 2009
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have found this

    <strong> - Strictly a structure element.
    If you want text to be spoken with strong emphasis using a speech reader, then wrap it in <strong></strong>.

    <b> - Strictly a presentational element.
    If you want text to be bold and not have any real semantic meaning, then wrap it in <b></b>.

  10. #10
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,868
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by seopeter View Post
    <b> - Strictly a presentational element.
    If you want text to be bold and not have any real semantic meaning, then wrap it in <b></b>.
    That is wrong as you should always use the semantically correct element and leave presentation to the CSS.

    There are instances where <b> DOES have a semantic meaning and its use should be reserved for those instances.

    If you want text to be bold without any real semantic meaning then the correct tag to use that conveys exactly that is <span style="font-weight:bold">. The <span> has no semantic meaning and the presentation is handled by the CSS as it should be.

    If <b> were strictly a presentational element then it would have been deprecated in HTML 4.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  11. #11
    SitePoint Zealot sdavis2702's Avatar
    Join Date
    Sep 2007
    Location
    Austin, TX
    Posts
    161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    AWESOME information in this thread. Thanks. I had no clue that they were different. I thought that one was replacing the other.
    I build WordPress with the Volatyl Framework.

  12. #12
    SitePoint Zealot
    Join Date
    Jul 2009
    Posts
    111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    B Tags: bold visual effects. Itself does not have the HTML semantics.

    Strong tags: bold visual effects. HTML semantics is stressed that the emphasis on tone, heavier.

    From the SEO point of view, between the two is not easy to define. I once read an article is to use b and the strong do a test, The same two articles, one with b do title tags, one with the strong, as the title tag. The final test results is strong to do the title of the article ranked front.

  13. #13
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,868
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by czissis View Post
    B Tags: bold visual effects. Itself does not have the HTML semantics.
    Read the above thread. It does have a semantic meaning relating to typography. You should always use the most appropriate semantic tag. HTML tags have no effect whatever on SEO apart from where they help the search engine to understand what the content means.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  14. #14
    SitePoint Zealot My220x's Avatar
    Join Date
    Dec 2008
    Location
    United Kingdom
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow, that was some great information. I thought <b></b> was just strictly presentational however it looks like I was wrong and The Build Your Own Website The Right Way Book where I am sure it says it's presentational and shouldn't be used.

    I know it has been said already but don't use <strong></strong> to make your text bold use it to add a forceful tone to it when read.

  15. #15
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,868
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by My220x View Post
    I thought <b></b> was just strictly presentational
    All the strictly presentational tags were deprecated (flagged as obsolete) in HTML 4. <b> and <i> are not deprecated because they do have a semantic meaning. They are probably the most misused tags in HTML though (even more so than tables).

    <b> should not be used as a presentational tag to make text bold when the intention is to apply emphasis to the content. It should only be used where the content is specifically meant to be bold because being bold has a semantic meaning. Generally unless you are writing about typography or some topic where bold text has acquired a specific meaning then you shouldn't be using it.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


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
  •