Happy Holidays, everyone. I just like to share something which isn't new to you all but may be new to some who aren't frontend "monkeys" or "ninjas" and I don't fall in any of those categories but still credible to write about what I've learned. I'm new to HTML5 but I've been using HTML5 a lot in practically all of my Rails 3 applications. I do not believe that I need to support Internet Explorer 6. It's almost 2011 and I think it's just about time that we stop supporting version 6. It would not benefit you financially if you chose to do so. That's a fact.

Why Use HTML5?

Search Engine Optimization. That's all I can say because that is my reason.

Custom Data Attributes For Tooltips

I recently found a need for a custom data attribute to be used with a jQuery plugin called Qtip. So each link could have a title attribute but the problem is it isn't good practice to add a long text for the title attribute. That's when I thought quickly about custom data attribute.

%a{"data-description" => "Test Description.", href: "http://www.somedomain.com"} Test Description

Headings within header and headers within articles or sections

What are headings? They are the tags h1, h2, h3, h4, etc. At first I thought that the header tag was synonymous to the masthead. But it's not. Your HTML5 code can have several header tags. A page can only have one masthead. Jeremy Keith pointed out that is actually sensible to have header tags within article or section tags.

%article
  %header
    %h1 Ruby on Rails or Sinatra?
  %p Ruby on Rails and Sinatra are both frameworks. Ruby on Rails uses MVC while Sinatra doesn't. Sinatra is faster but doesn't come with the conveniences that Ruby on Rails provides like scaffolding. Still, it uses Ruby that's why I like it very much.
  %footer
    %p
      Published
      %time{datetime: "2010-12-26T15:13", pubdate: ""} 3:13pm on December 26th, 2010
      by Katherine Pe

Similar to the header tags, the footer could exist within an article or section tag. You can sensibly use article tag for grouping a blog content.

So the common misunderstanding about these elements is that they signify the position on a page when they actually don't.

comments powered byDisqus

Hello! I am Kat. I've been a developer for several years. When I'm not sitting down, reading and working for long hours, I am traveling to some place of interest.
If you want to reach out, you can send me an email or add me up on Google Plus.