HTML and CSS Reference
In-Depth Information
Previously, sliders needed to be faked by hijacking an input
and using JavaScript and images for the pointers. Because
these were not native in the browser, great care needed to be
taken—and extra code written—to ensure keyboard accessibility.
Now that sliders are natively part of HTML, the responsibility is
removed from the developer, leading to leaner code and greater
accessibility for keyboard users.
See the example in the “Putting All This Together” section for
more information.
The search input type
This input type expects a search term. In Safari there is also an
unspecifi ed attribute that adds a history of recent results, using
the results=n attribute. The difference between search and text
type is only stylistic, and in Safari on the Mac, it takes the oper-
ating system's default rounded-corners style for search —which
can nonetheless be overwritten with some proprietary CSS (hat-
tip to Wilf Nas for this):
input[type=”search”] {-webkit-appearance: textfield;}
The tel input type
The tel type expects a telephone number. There is no special
validation; it doesn't even enforce numeric-only input, as many
phone numbers are commonly written with extra characters, for
example +44 (0) 208 123 1234.
As mobile phones “know” their own number, we expect that
most mobile phones will be able to do things like autocomplet-
ing these entry fi elds. None currently does this, although the
iPhone brings up a telephone number input screen ( Figure 3.8 ).
FIGURE 3.8 The iPhone's
keypad for completing
<input type=tel> .
Search WWH ::

Custom Search