W3C hibernated for years:
- HTML was last updated in 1999;
- XHTML was last updated in 2002.
WHATWG (Web Hypertext Application Technology Working Group)was started by Google, Mozilla, Apple and Opera since in 2004 to develop the next generation of Web markups’ standards. Then they submitted an HTML 5 draft proposal, intending to replace the current HTML and XHTML.
So W3C decided to
- accept the HTML5 proposal from WHATWG
- release the next version of HTML as HTML5.
Unlike usual W3C working groups before, this group consists of members on behalf of key companies which will lead new Web Standards into practice:
In the HTML 5 differences from HTML 4 draft, improvements of HTML 5 can be seen, like changes of grammars, and removed elements and attributes.
HTML 5 can be declared via HTML grammar:
<!doctype html> <html> <head> <meta charset="UTF-8"> <title>Sample document</title> </head> <body> <p>Sample paragraph</p> </body> </html>
as well as XML grammar:
<?xml version="1.0" encoding="UTF-8" ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Sample document</title> </head> <body> <p>Sample paragraph</p> </body> </html>
Elements like div, li, etc., become more strict. For example, these elements should not includes block level elements and inline elements. These code are valid:
<div> <em>...</em> ... </div> <div> <p><em>...</em></p> <p>...</p> </div>
But the following code is invalid:
<div> <em>...</em> <p>...</p> </div>
This is helpful to identify the level the elements.
- Pure presentation: <basefont>, <big, <center>, <font>, <s>, <strike>, <tt>, <u>;
- Negative for usability: <frame>, <frameset>, noframes>;
- Obscure:<acronym> , <applet>, <isindex>, <dir>.
- accesskey attribute of <a, <area>, <button>, <input>, <label>, <legend> and <textarea>;
- rev and charset attributes of <link and <a>;
- sshape and coords attributes of <a>;
- longdesc attribute of <img and <iframe>;
- target attribute of <link>;
- nohref attribute of <area>;
- profile attribute of <head>;
- version attribute of <html>;
- name attribute of <map>, <img>, <object>, <form>, <iframe>, and <a> (should be replaced id attribute);
- scheme attribute of <meta>;
- archive, classid, codebase, codetype, declare and standby attributes of <object>;
- valuetype and type attributes of <param>;
- charset and language attributes of <script>;
- summary attribute of <table>;
- headers, axis and abbr attributes of <td>, and <th>;
- scope attribute of <td>;
- align attribute of <caption, <iframe>, <img>, <input>, <object>, <legend>, <table>, <hr>, <div>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <p>, <col>, <colgroup>, <tbody>, <td>, <tfoot>, <th>, <thead>, <tr>, and <body>;
- alink, link, text and vlink attributes of <body>;
- background attribute of <body>;
- bgcolor attribute of <table>, <tr, <td, <th>, and <body>;
- border attribute of <table>, <img>, and <object>;
- cellpadding and cellspacing attributes of <table>;
- char and charoff attributes of <col>, <colgroup>, <tbody>, <td>, <tfoot>, <th>, <thead>, and <tr>;
- clear attribute of <br>;
- compact attribute of <dl>, <menu>, <ol>, and <u>;
- frame attribute of <table>;
- frameborder attribute of <iframe>;
- height attribute of <iframe>, <td> and <th>;
- hspace and vspace attributes of <img> and <object>;
- marginheight and marginwidth attributes of <iframe>;
- noshade attribute of <hr>;
- nowrap attribute of <td>, and <th>;
- rules attribute of <table>;
- scrolling attribute of <iframe>;
- size attribute of <hr>, <input>, and <select>;
- style attribute of all elements with the exception of <font>;
- type attribute of <li>, <ol>, and <ul>;
- valign attribute of <col>, <colgroup>, <tbody>, <td>, <tfoot>, <th>, <thead>, and <tr>;
- width attribute of <hr>, <table>, <td>, <th>, <col>, <colgroup>, <iframe>, and <pre>.
Currently, regarding future compatibility, these removed elements and attributes should be avoided.