Appendix I

Changes between HTML4 and HTML5

This document outlines the major element differences between HTML4 and HTML5. For a full view of all the changes, see the W3C’s document “HTML5 Differences from HTML4” at www.w3.org/TR/html5-diff/.

New Elements

The following list represents all the new elements introduced in HTML5. For descriptions of these elements, see Appendix B, “HTML Element Reference”:

  • section
  • article
  • aside
  • hgroup
  • header
  • footer
  • nav
  • figure
  • figcaption
  • video
  • audio
  • track
  • embed
  • mark
  • progress
  • meter
  • time
  • ruby
  • rt
  • rp
  • bdi
  • wbr
  • canvas
  • command
  • cetails
  • catalist
  • keygen
  • output

New <input> Element Types

The input element’s type attribute now has the following new values. For descriptions of these elements, see Appendix B, “HTML Element Reference”:

  • tel
  • search
  • url
  • email
  • datetime
  • date
  • month
  • week
  • time
  • datetime-local
  • number
  • range
  • color

New Attributes

Many new attributes have been added to existing elements. These new attributes either are existing attributes added to new elements or are completely new attributes. These are also covered in depth alongside their elements in Appendix B, “HTML Element Reference”:

ElementAttributes
<a>media
<area>hreflang, media, rel, type
<base>target
<button>autofocus,form, formaction, formenctype, formmethod, formnovalidate, formtarget
<fieldset>disabled, form, name
<form>novalidate
<html>manifest
<iframe>sandbox, seamless, srcdoc
<img>crossorigin
<input>autocomplete, autofocus, dirname, form,formaction, formenctype, formmethod, formnovalidate, formtarget list,max,min, multiple,pattern,placeholder, required, step, height, width
<label>form
<link>sizes
<menu>label, type
<meta>charset
<object>form, typemustmatch
<ol>reversed
<output>form
<script>async
<select>autofocus, form,required
<style>scoped
<textarea>autofocus, form,maxlength,placeholder,required,wrap, dirname

Global Attributes

HTML5 greatly expands on the number of global attributes. The following list includes all the new global attributes and the global attributes present in previous versions of HTML:

  • accesskey
  • class
  • contenteditable
  • contextmenu
  • dir
  • draggable
  • dropzone
  • hidden
  • id
  • lang
  • spellcheck
  • style
  • tabindex
  • title
  • translate

Changed Attributes

Several existing attributes have had their meanings changed:

AttributeElementChange
accept<input>audio/*, video/*, and image/* are now valid values.
accesskey global Now allows multiple characters to be specified.
action<form>No longer allowed to have an empty URL.
colspan<td><th>Now has to be greater than zero.
coords <area>No longer allows a percentage value of the radius when the element is a circle.
data <object> No longer relative to the codebase.
defer <script>Explicitly executes the script when the page has finished parsing.
dir global Now allows the value auto.
enctype<form>Now supports the value text/plain.
width/height<img>, <iframe>, <object>No longer allowed to contain percentages. No longer allowed to stretch the image to a different aspect ratio than its intrinsic aspect ratio.
href<link>No longer allowed to have an empty URL.
href<base>Allowed to contain a relative URL.
Attributes that accept URLsglobalNow support IRIs if the document’s encoding is UTF-8 or UTF-16.
http-equiv<meta>No longer said to be used by HTTP servers to create HTTP headers in the HTTP response. Instead, it is said to be a pragma directive to be used by the user agent.
idglobal Now allowed to have any unique value, as long as it is not an empty string and does not contain spaces.
langglobalTakes the empty string in addition to a valid language identifier.
media<link>Now accepts a media query. Defaults to “all.”
Event handlersglobalDefaults to JavaScript as the scripting language.
value<li>No longer deprecated.
start/type<ol>No longer deprecated.
styleglobalAlways uses CSS as the style language.
tabindexglobalAllows negative values, which indicates that the element can receive focus but cannot be tabbed to.
target<a><area>No longer deprecated.
type<script><style>No longer required if the scripting language is JavaScript and the styling language is CSS, respectively.
usemapimgNo longer takes a URL, but instead takes a valid hash-name reference to a map element.

Obsolete Elements

The elements in this section are no longer part of the HTML specification:

  • basefont
  • big
  • center
  • font
  • strike
  • tt
  • frame
  • frameset
  • noframes
  • acronym
  • applet
  • isindex
  • dir

Obsolete Attributes

Some attributes from HTML4 are no longer allowed in HTML5:

ElementAttributes
<a>charset, coords, rev, shape
<area>nohref
<body>alink, background, bgcolor, link, text, vlink
<br>clear
<caption>align
<col>align, char, charoff, valign, width
<colgroup>align, char, charoff, valign, width
<div>align
<dl>Compact
<head>profile
<hn>align
<hr>align, noshade,size, width
<html>version
<iframe>align, frameborder, longdesc, marginheight, marginwidth, scrolling
<img>align, hspace, longdesc, name, vspace
<input>align
<legend>align
<li>type
<link>charset, rev, target
<menu>compact
<meta>scheme
<object>align, archive, border, classid, codebase, codetype, declare, space, standby, vspace, hspace
<ol>compact
<p>align
<param>type, valuetype
<pre>width
<table>align, bgcolor, cellpadding,cellspacing, rules, summary, width, frame
<tbody>align, char, charoff, valign
<td>abbr,align, axis, bgcolor char, charoff,height,nowrap, scope,valign, width
<tfoot>align char, charoff, valign
<th>abbr, align,axis, bgcolor char, charoff,height,nowrap, valign, width
<thead>align, char, charoff, valign
<tfoot>align, char, charoff, valign
<tr>align, bgcolor,char, charoff, valign
<ul>compact, type

At-Risk Elements

The following elements and attribute types are at risk of being removed from the specification:

  • <hgroup>
  • <command>
  • <menu>
  • <dialog>
  • <details>
  • <summary>
  • <input type=color>
  • <input type=datetime>
  • <input type=month>
  • <input type=week>
  • <input type=time>
  • <input type=datetime-local>
  • <output>
  • <style scoped>
  • <iframe seamless>
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset