HTML and CSS Reference
In-Depth Information
Exploring HTML5 Data Types
Alice has had a chance to review your work on the survey form. She has several new
fields to add to the survey form, including a data field for the number of times a cus-
tomer dines out per month, and data fields in which the customer can provide a numeric
rating of Red Ball Pizza's food and service quality.
Alice wants numbers stored in these fields, but so far your survey form has only
recorded text values. However, HTML5 introduced 13 new data types, including data
types for numeric values. These new data types are not uniformly supported across the
browser market at the time of this writing, but you can still use many of them today.
Figure 6-48 summarizes the new data types provided by HTML5. The images of the
input controls are taken from the Opera Web browser, which currently has the best
support for the new data types. Other browsers have mixed levels of support. At the
time of this writing, Internet Explorer does not support the new HTML5 data types at all.
However, as HTML5 increases in popularity, this will rapidly change and Web designers
will be able to use them with greater confidence.
figure 6-48
Html5 data types
Type
Description
General Appearance
color
An RGB color value that can be selected from a color
picker dialog box
date
A date (year, month, day) with no specified time zone
A date and time (year, month, day, hour, minute, second,
fraction of a second) with the time zone set to Coordinated
Universal Time (UTC)
datetime
A date and time (year, month, day, hour, minute, second,
fraction of a second) with no specified time zone
datetime-
local
An e-mail address or list of e-mail addresses
email
A date consisting of a year and a month
month
number
A numeric value
range
A numeric value selected from a defined range of values
search
A text string usually used for performing searches
tel
A telephone number
time
A time value (hour, minute, seconds, fractional seconds)
url
A URL of a Web site or Internet resource
week
A date consisting of a year number and a week number
Search WWH ::




Custom Search