Beispiel:HTML input-element auswahl-typen.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>input-Elemente zur Eingabe einer Auswahl</title>
  <style>
    body {
      margin: 2em;
    }
    form {
      width: 25em;
      margin-top: 2em;
    }
    input {
      margin: 0 0 1.5em .5em;
    }
    label { 
      float: left; 
      text-align: right; 
      width: 15em; 
    }
    label::after {
      content: ": ";
    }
  </style>
</head> 

<body>
  <h1>input-Elemente zur Eingabe einer Auswahl</h1>
  <form> 
    <label for="radio1">type = "radio"</label>
    <input type="radio" id="radio1" name="radio">
    <br>
    <label for="radio2">type = "radio"</label>
    <input type="radio" id="radio2" name="radio">
    <br>

    <label for="checkbox">type = "checkbox"</label>
    <input type="checkbox" id="checkbox">
  </form> 
</body>
</html>