treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Presentational HTML - Semantically Useful or Deprecated?

  • Do you use the <small> tag in your designs? Or the <b> or <i> tags instead of <strong> or <em> anymore? I posted on my blog about this topic and I was curious to see what the rest of you thought about it.
  • Using <small> is a very good way to point out the obvious - that it's supposed to be small. Likewise for <big>. It's also easier if you're going to create a website that'll work for mobile devices.

    Try to turn off your CSS, and see the difference when you use <small>/<big>. If you don't use the tags, you can disable the CSS on my weblog.

    Why didn't you mention <tt> in your blog post? Although it's big-brother <code> rules town, the <tt>-tag is still in XHTML DTDs 8-)
  • "koewnet" said:
    Why didn't you mention <tt> in your blog post? Although it's big-brother <code> rules town, the <tt>-tag is still in XHTML DTDs 8-)


    There's definitely a whole slew of tags to get into more debate over... It's pretty frustrating not knowing whether to use <tt>, <code>, or <pre> when showing code in a post... everyone seems to have their favorite.
  • Its good to be aware of the semantic value of tags and make some pains to make your markup meaningful. For me if I'm writing some code, I'll use the <code> tag. Similarly, I won't use 'big' or 'small' as they have a visual implication and not a meaningful one - instead I use 'strong' and 'em', then style them with an external stylesheet. Again, 'tt' has no meaning as such, so I would probably use a 'span' and style it with a mono-spaced font.
  • <code> will usually be rendered in a monospaced font, but multiple spaces are collapsed, unlike in <pre>. This can screw up the spacing in your code if you want to provide more than one line.