HTML5-Formularelemente
by Jens Grochtdreis
HTML
<div id="wrap">
<form action=".">
<div>
<label for="type-text">Text (<input type="text">)</label>
<input type="text" name="type-text" id="type-text">
</div>
<div>
<label for="type-search">Suchfeld (<input type="search">)</label>
<input type="search" name="type-search" id="type-search">
</div>
<div>
<label for="type-tel">Telefon (<input type="tel">)</label>
<input type="tel" name="type-tel" id="type-tel">
</div>
<div>
<label for="type-url">URL (<input type="url">)</label>
<input type="url" name="type-url" id="type-url">
</div>
<div>
<label for="type-email">E-Mail (<input type="email">)</label>
<input type="email" name="type-email" id="type-email">
</div>
<div>
<label for="type-datetime">Datum und Zeit (<input type="datetime">)</label>
<input type="datetime" name="type-datetime" id="type-datetime">
</div>
<div>
<label for="type-date">Datum (<input type="date">)</label>
<input type="date" name="type-date" id="type-date">
</div>
<div>
<label for="type-month">Monat (<input type="month">)</label>
<input type="month" name="type-month" id="type-month">
</div>
<div>
<label for="type-week">Woche (<input type="week">)</label>
<input type="week" name="type-week" id="type-week">
</div>
<div>
<label for="type-time">Zeit (<input type="time">)</label>
...
CSS
/* styling basics */
html {padding: 20px 0; background-color: #efefef;}
body {width: 80%; padding: 40px; margin: 0 auto; background: #fff; box-shadow: 1px 1px 5px rgba(0,0,0,0.5); font-family: Verdana, Arial, sans-serif; font-size: 14px;}
form {margin-bottom: 30px;}
form div {margin-bottom: 15px;}
label {margin-bottom: 5px; display: block; }