HTML5: a few basics 0
Web browsers, generally, only support certain features of HTML5. An easy way to determine which features are supported in a browser, is to use the Modernizr tool.
A few general tag changes:
- Simple doc type: <!DOCTYPE html>
- Simple encoding scheme: <meta charset=”utf-8″>
- The type attribute is no longer required:
<script src=”js/main.js”></script>
<script> var now = new Date(); </script>
<style> body { margin: 0px; } </style>
<link rel=”stylesheet” href=”css/main.css” media=”screen”>
A few new semantic tags:
- <article> = an on-its-own-feet-standing piece of content.
Ask yourself: would this information make sense if I cut it out of the page and pasted it somewhere else completely? - <section> = used to divide up content (of an article or page) in a logical way.
- <aside> = content that is useful, but could be removed while the rest of the content would still make sense.
A few new hierarchical tags:
- <hgroup> = used to group multiple <h#> tags into one headline.
<hgroup>
<h1>This is my title</h1>
<h2>This is my smart-ass tag line</h2>
</hgroup>
In this case, only the <h1> element will be considered in the page’s hierarchy. Meaning that everything below this <hgroup> is represented by the <h1>. The information in <h2> is secondary. - <figure> and <figcaption> = groups together an image, table, quote, … and its caption on the page
<figure>
<img src=”images/myimage.php”>
<figcaption>Caption of my image</figcaption>
</figure>







