Beispiel:HTML input-Element1.html

Aus SELFHTML-Wiki
Wechseln zu: Navigation, Suche
<!DOCTYPE html>
<html lang="de">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <link rel="stylesheet" media="screen" href="./Beispiel:SELFHTML-Beispiel-Grundlayout.css" />
  <title>Formular mit input und label</title>
  <style>
    body {
      margin: 2em;
    }
    form {
      width: 20em;
      margin-top: 2em;
    }
    input {
      margin: 0 0 1.5em .5em;
    }
    label { 
      float: left; 
      text-align: right; 
      width: 10em; 
    }
    .button {
      float: right;
      margin-top: 3em;
    }
  </style>
</head> 

<body>
  <h1>Beispiele für Input-Elemente</h1>
  <form> 
     <label for="Vorname">Vorname: </label>
     <input type="text" id="Vorname" name="Vorname">
     <br>
     <label for="Zuname">Zuname: </label>
     <input type="text" id="Zuname" name="Zuname">
     <br>

     <label for="männl">männlich: </label>
     <input type="radio" name="geschlecht" id="männl" value="männl"><br>
     <label for="weibl">weiblich: </label>
     <input type="radio" name="geschlecht" id="weibl" value="weibl"><br>
     <label for="queer">queer: </label>
     <input type="radio" name="geschlecht" id="queer" value="queer"><br>
  
     <label for="alter">über 18:</label>
     <input type="checkbox" id="alter"><br>
     
     <button type="submit">Und ab damit!"</button> 
  </form> 

</body>
</html>