Showing posts with label HTML5. Show all posts
Showing posts with label HTML5. Show all posts

Thursday, 28 November 2013

Using Table as layout in HTML 5

The HTML5 specification still recommends that you don't use tables for layout, but if you do, you should differentiate those tables from tables that are used for tabular data.

Features to Define Your Table as Layout or Non-Layout

Feature of Table Is a Layout Table?
<table role="presentation"> It probably is a layout table
<table border="0"> It probably is a layout table
<table cellpadding="0"> It probably is a layout table
<table cellspacing="0"> It probably is a layout table
Use of the CAPTION, THEAD, or TH elements It probably is not a layout table
Use of the headers and scope attributes on the TH element It probably is not a layout table
<table border=""> It probably is not a layout table
<table border="1"> It probably is not a layout table
Visible borders set with CSS It probably is not a layout table

Tuesday, 31 January 2012

History API

The History API is an API to give you control over the browser history.

The History API is an API to give you control over the browser history. In other words, you can add, delete, and change titles and URLs in the browser history field so that when your readers click the back button, they go to a URL that you have specified.

It is useful for photo gallery (when using Ajax to browse the image on the same page).  With the History API, you can change the URI to reflect the exact photo and the user can bookmarks the page and will return to the last photo they view.

If the browser doesn't support History API, this script history.js will help.

more info on how to use history API...

Tuesday, 10 January 2012

HTML5 HGROUP Element

The HTML5 HGROUP element is used to group headings so that they don’t show up in the HTML5 outline.


Since outlines are written with one headline per level, the HGROUP element helps keep the pages organized and keep the outlines looking clear. The HGROUP element allows you to group heading tags so that they do not appear in the outline. Instead they are all grouped together into one section.

  • only heading elements can be inside it
  • should not include any content outside of the H1–H6 elements

Tuesday, 3 January 2012

HTML5 DATA Element

This element represents data with a machine-readable value attribute attached so that computers can understand that it is data as well.

<data class="dtstart" value="2011-12-02">December 2</data> –
<data class="dtend" value="2011-12-10">10</data>

The Difference Between the HTML5 DATA Element and the CODE Element