SitePoint Sponsor

User Tag List

Results 1 to 14 of 14

Thread: Using bold tags

  1. #1
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    calif
    Posts
    743
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using bold tags

    Someone suggested I use

    Code:
    <strong>
    instead of

    Code:
    <b>
    Does it make any difference?

    Thanks

  2. #2
    SitePoint Enthusiast
    Join Date
    Oct 2009
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi ChrisJChrisJ,

    Interesting question.

    Already a bit of information here:

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

    My understanding has always been that

    <b> is to make an element look bold (now superceded by CSS <span style="font-weight:bold">bold!</span>
    <strong> is used to emphasise the context within, for example, speach recognition software but for display purposes is renders the same as <b>.

    I always use CSS for any style enhancement including bold. Not sure if I'm missing an SEO opportunities by doing that or if there's any other advantage.

    So, for me CSS, then <b>, then <strong> but as I say, interesting question.

    Regards,


    David
    David McLeary
    Emerging Innovations
    Website Development, Training and Consultancy

  3. #3
    Resident curmudgeon bronze trophy gary.turner's Avatar
    Join Date
    Jan 2009
    Location
    Dallas
    Posts
    990
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The <b> and <i> elements have semantic meaning according to context and typographic convention. For example, in an article about people, it is convention to make bold the first instance of a name. Convention also calls for ships' names to be bold. Book titles used to be bold, but are more commonly italic now. These are not presentational; the bold says "I'm a person's name", or "this is a ship". Likewise, the italic says "this is a book". The meaning is dependent on context, but it is a semantic value, just as <p> defines a paragraph, or <h1> a top level heading.

    The <b> is not related semantically to <strong>, and css does not impart a semantic value where <b> or <strong> should be used (though you're free to style either 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

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,875
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by dmcleary View Post
    <b> is to make an element look bold (now superceded by CSS <span style="font-weight:bold">bold!</span>
    <span style="font-weight:bold"> may have the same result as <b> but it has a totally different meaning.

    In most cases where <span style="font-weight:bold"> would be applicable what you really mean is <strong> because in most cases making something bold is intended to apply strong emphasis to it. Using <strong> to apply emphasis rather than <span style="font-weight:bold"> is better because that will also work when CSS is turned off and with media such as webreaders where there is nothing written to make bold.

    <b> as already indicated has an entirely different meaning of being a person or ship's name and has nothing whatever to do with emphasis. You need to understand the typographical conventions used in the specific field you are writing about to be able to know what semantically belongs inside <b> tags.
    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="^$">

  5. #5
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,350
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by dmcleary View Post
    <b> is to make an element look bold (now superceded by CSS <span style="font-weight:bold">bold!</span>
    sorry, no, the B tag has not been superceded
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  6. #6
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    It makes a significant difference and hence why the <B> element is not deprecated in HTML and typically if you want to make darker text/typography you'd use CSS.

    If you want to emphasis you use <EM> and for Strong Emphases <STRONG> note <B> just (typically) renders bold text; you cannot speak in an italicised or bold style. Albeit you can speak in an emphasis form.

  7. #7
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,875
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    The following is a perfectly valid use of <b> for which no alternative in HTML exists (unless you were to code <span class="shipname"> instead - which isn't necessary when an HTML tag with that meaning exists as is the case since anyone involved with ships knows that typographically ship names are written in bold text as a specific typographical convention).

    HTML Code:
    <p>The ship <b>Queen Elizabeth II</b> pulled 
    into the dock.</p>
    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="^$">

  8. #8
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    The following is a perfectly valid use of <b> for which no alternative in HTML exists (unless you were to code <span class="shipname"> instead - which isn't necessary when an HTML tag with that meaning exists as is the case since anyone involved with ships knows that typographically ship names are written in bold text as a specific typographical convention).

    HTML Code:
    <p>The ship <b>Queen Elizabeth II</b> pulled 
    into the dock.</p>
    If the b tag didn't result in the presentational value, then would it still be used in web documents?

    This is a hole that needs to be fixed in html vocabulary.

    A new tag should be created for situations such as the one you presented.

  9. #9
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,875
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by cooper.semantics View Post
    If the b tag didn't result in the presentational value, then would it still be used in web documents?

    This is a hole that needs to be fixed in html vocabulary.

    A new tag should be created for situations such as the one you presented.
    The convention for ship names is that the name be marked as bold. The <b> tag is therefore the correct one in that instance since iit indicates the ship name. How that appears in the web browser is determined by the CSS which has nothing to do with what tag is used in the HTML. Just reading the HTML source makes it clear what is what.

    Since the only use for the <b> tag is this one and other similar typographical conventions in other fields there would be no use for the <b> tag at all if it were not for instances like this one.
    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="^$">

  10. #10
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    Since the only use for the <b> tag is this one and other similar typographical conventions in other fields there would be no use for the <b> tag at all if it were not for instances like this one.
    Right, but the only reason why the b or sometimes i tag are used, is because of the presentational value.

    Lets say the b or i tag values in all cases = font-weight/font-style normal(which it clearly doesn't), then what purpose would the b or i tag be utilized for?

    This typographic convention is primarily based off of presentational values.

    P.S
    Not many people look in the html markup, and if so, bold conveys its presentational value and not the intended meaning of the text.

  11. #11
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,875
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by cooper.semantics View Post
    This typographic convention is primarily based off of presentational values.
    yes but the typographical convention still gives a semantic meaning to the tags when applied that way and is the only time that bold and italic ever have a semantic meaning. That the reason for that semantic meaning is based off of a presentational effect doesn't invalidate the semantics of specifying it that way. After all the bold or italic in those cases are not applying emphasis and so strong and em are not substitutes for them in those cases. Rhe only other way you could specify it would be with a span tag and a class but why do that when a separate tag with the same semantic meaning exists in HTML.
    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="^$">

  12. #12
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Hmmm, <b> and <i> are within a Presentation Module; in either case generally speaking a ships name is typographically written with <I> rather than <B>.

    Off Topic:

    Now, if you were referencing her, and her name and actions; Regalskeppet Vasa you would use the <cite> element.

  13. #13
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    Rhe only other way you could specify it would be with a span tag and a class.
    True, and this way would fail with css disabled(the span method that is). This in my mind is the main reason why the b tag still stands for cases as we've discussed.

    Although, I wouldn't push the theory that the b tag(in any case) has any sort of semantic value.

    I would right this off as a presentational must... hehe

  14. #14
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Just because it's been abused for the wrong reasons does not mean it should be abandoned, the b and i elements do have semantic value. The bold element should be used to highlight key words or phrases that relate to the document but have no inherent emphasis or strength behind them. Italics of course are mainly used for names of objects, people and word definition references (at least they are in my book). I entirely agree that they still have a valid semantic purpose.


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
  •