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
General Appearance
An RGB color value that can be selected from a color
picker dialog box
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)
A date and time (year, month, day, hour, minute, second,
fraction of a second) with no specified time zone
An e-mail address or list of e-mail addresses
A date consisting of a year and a month
A numeric value
A numeric value selected from a defined range of values
A text string usually used for performing searches
A telephone number
A time value (hour, minute, seconds, fractional seconds)
A URL of a Web site or Internet resource
A date consisting of a year number and a week number
Search WWH ::

Custom Search