23.02.2018 Views

duckett

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Example<br />

HTML5 LAYOUT<br />

This example shows a cooking site built using<br />

new HTML5 elements to describe the structure<br />

of the page (rather than just grouping items<br />

using elements).<br />

The header and footer of the page sit inside and <br />

elements. The courses are grouped together inside a <br />

element that has a class attribute whose value is courses (to<br />

distinguish it from other elements on the page). The sidebar<br />

sits inside an element.<br />

Each of the courses lives inside an element, and use the<br />

and elements to contain an image. The<br />

headings for the courses have subheadings, so these are grouped inside<br />

an element. In the sidebar, the recipes and contact details are<br />

placed inside separate elements.<br />

The page is styled using CSS. The only difference is that our selectors<br />

are using the new HTML5 elements to allow us to create rules that<br />

target those elements. In order for the CSS to work in versions of IE<br />

before Internet Explorer 9, the HTML5 page contains a link to the<br />

HTML5 shiv JavaScript (hosted on Google's servers) inside a<br />

conditional comment.<br />

HTML5 LAYOUT<br />

444

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!