Beispiel:Formular-12.html
Aus SELFHTML-Wiki
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Formular 12 - Altersabfrage</title>
<style>
form {
display: grid;
grid-template-columns: 15em 10em;
padding: 1em;
label {
grid-column: 1/2;
text-align: right;
line-height: 1.5;
}
label > button {
display: block;
}
input {
margin: 0 0 1em .5em;
padding: .2em .5em;
background-color: #fffbf0;
border: thin solid #e7c157;
}
button {
margin-top: 1.5em;
width: fit-content;
}
}
label::after {
content: ": ";
}
input:invalid {
border: medium solid red;
}
</style>
</head>
<body>
<h1>Altersabfrage</h1>
<form>
<label for="age">Alter</label>
<input id="age" type="number" inputmode="dec">
<label for="birthday">Geburtsdatum</label>
<input id="birthday" type="date" inputmode="dec">
<button type="submit">Absenden</button>
</form>
</body>
</html>