www.webdeveloper.com
Results 1 to 13 of 13

Thread: i and b vs em and strong?

  1. #1
    Join Date
    Aug 2004
    Location
    Colorado
    Posts
    7

    i and b vs em and strong?

    What's up with the continued use of i and b for italics and bold? Weren't these supposed to go bye-bye in vafor of em and strong?
    Marshall V Pierce

  2. #2
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270

    Re: i and b vs em and strong?

    Originally posted by TheRealMVP
    What's up with the continued use of i and b for italics and bold? Weren't these supposed to go bye-bye in vafor of em and strong?
    EM isn't for italic, nor is STRONG for bold. They're for emphasis and strong emphasis.

    Myself, I like to use the I element for Latin text, but my wife complains when I do.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  3. #3
    Join Date
    Dec 2003
    Location
    A series of tubes known as the "internets"
    Posts
    2,165
    <i> has been replaced by
    PHP Code:
    style="font-style:italic" 
    and <b> by
    PHP Code:
    style="font-weight:bold" 
    "Outside of a dog, a book is a man's best friend. Inside a dog, it is too dark to read." - Mark Twain

  4. #4
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    Originally posted by rhsunderground
    <i> has been replaced by
    PHP Code:
    style="font-style:italic" 
    and <b> by
    PHP Code:
    style="font-weight:bold" 
    Then please explain the following:
    From the HTML 4.01 Specification
    <!ENTITY % fontstyle "TT | I | B | BIG | SMALL">

    <!ELEMENT (%fontstyle;|%phrase;) - - (%inline;)*>
    <!ATTLIST (%fontstyle;|%phrase;)
    %attrs; -- %coreattrs, %i18n, %events --
    >
    Last edited by Charles; 08-27-2004 at 06:17 AM.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  5. #5
    Join Date
    Dec 2003
    Location
    UK
    Posts
    1,141
    I thought em and strong replaced i and b becuase they had a much larger semantic meanging but im ready to be proved wrong.

  6. #6
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    Originally posted by sharkey
    I thought em and strong replaced i and b becuase they had a much larger semantic meanging but im ready to be proved wrong.
    Then please explain the following:
    From the HTML 2.0 Specification
    <!ENTITY % font " TT | B | I ">

    <!ENTITY % phrase "EM | STRONG | CODE | SAMP | KBD | VAR | CITE ">

    <!ENTITY % text "#PCDATA | A | IMG | BR | %phrase | %font">

    <!ELEMENT (%font;|%phrase) - - (%text)*>
    The B, I, EM, STRONG and CITE elements have all been there since the beginning. What has changed is that in the past presentation and semantic mark up were co-equal uses of HTML. The semantic now trumps but the presentation is there just in case. In practice there is never any reason to use TT or B or I - unless you want to use I for Latin, id est: <i lang="la" title="and the rest">id est</i>
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  7. #7
    Join Date
    Dec 2003
    Location
    UK
    Posts
    1,141
    Ah i never seen you had that html specification above. I was ready to be correct and i got corrected

  8. #8
    Join Date
    Dec 2003
    Location
    A series of tubes known as the "internets"
    Posts
    2,165
    Originally posted by Charles
    Then please explain the following:
    magic
    "Outside of a dog, a book is a man's best friend. Inside a dog, it is too dark to read." - Mark Twain

  9. #9
    Join Date
    Jan 2004
    Location
    Alabama, United States
    Posts
    836

    Re: Re: i and b vs em and strong?

    Originally posted by Charles
    EM isn't for italic, nor is STRONG for bold. They're for emphasis and strong emphasis.
    That is correct. And they are not meant to plain italicize or bold text but to give emphasis to one word or phrase. If you want to simply italicize or bold text, then the mentioned CSS method should be used; as it is sematecally correct.

  10. #10
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    18,922
    One advantage of EM and STRONG is that you can define them in your CSS stylesheet to display as desired. If you change your mind, you just change the stylesheet. (You can similarly change how I and B display, but that could get pretty confusing.)
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  11. #11
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270

    Re: Re: Re: i and b vs em and strong?

    Originally posted by PhillMc
    That is correct. And they are not meant to plain italicize or bold text but to give emphasis to one word or phrase. If you want to simply italicize or bold text, then the mentioned CSS method should be used; as it is sematecally correct.
    But first one must ask why italic. If it is to add emphasis, as is likely, then the EM element should be used. If it is to indicate a citation, as is possible, then CITE should be used. Only then can one use I.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  12. #12
    Join Date
    Jan 2004
    Location
    Alabama, United States
    Posts
    836

    Re: Re: Re: Re: i and b vs em and strong?

    Originally posted by Charles
    But first one must ask why italic. If it is to add emphasis, as is likely, then the EM element should be used. If it is to indicate a citation, as is possible, then CITE should be used. Only then can one use I.
    Ah, I forgot about CITE. lol. Total agreement. It's all about semantecs.

  13. #13
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270

    Re: Re: Re: Re: Re: i and b vs em and strong?

    Originally posted by PhillMc
    Ah, I forgot about CITE.
    Online translators, like Babelfish, will leave alone anything inside a CITE element, which is what you want. It's not Being and Time it's Sein und Zeit. Correct mark up is always more important than you even realize.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles