Wednesday 4 January 2012

HTML5 INTRODUCTION

Introduction

     HTML5 syntax is compatible with both HTML4 and XHTML1. Want to close
empty elements with a slash? Go for it. Rather not? Then don't. Want to use
lower case? Upper case? Take your pick. In other words, you really don't have
to change the way you handle these things, so don't worry, ok?

HTML5 doctype is much simpler: 

New way:

<!doctype html>

Old ways: 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"> 
or 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Meta charset tag is much simpler:

New way:
<meta charset="UTF-8">
Old way:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />


Divs are now used for styling rather than structure; HTML5 includes several new structural elements that help define parts of the document.  Let's take a look at the main new structural elements that you'll probably use right away.(Note that included in the head is an HTML5 shiv that allows us to style elements in IE,and a basic CSS style is also included so we can help browsers that aren't caught up yet to render the new block-level elements as block-level elements. For now, it's easiest just to automatically include them. Understanding why can come later.)

                 This document serves as a reference guide for the HTML syntax, vocabulary and its associated DOM APIs and is intended for web site and application developers, publishers, tutorial writers and teachers and their students. That is, people who write documents using HTML, or who teach others to do so. This guide is structured into three major sections.
The first provides an introductory tutorial on writing HTML, explaining the basic structure and syntax of an HTML document, covering the fundamental techniques and best practices, encouraging the use of clean and valid markup, and the use of quality assurance tools.
The second section provides an in depth look at the syntax of HTML and XHTML documents. This will investigate both the similarities and differences between the two alternatives and provides guidance on choosing which to use for your own projects, depending on your needs. Additionally, this will also provide details about creating polyglot documents — that is, documents that conform to both HTML and XHTML simultaneiously — including issues related to ensuring stylesheets and scripts work correctly under both conditions.
The third and final section provides a reference for the HTML vocabulary. Each element is described, providing details about its its meaning, allowed attributes, content models and DOM APIs. Each is accompanied by clear examples illustrating how the element is designed to be used for a range of different use cases.


No comments:

Post a Comment