Beispiel:HTML form-Element2.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" />
  <style>
    form {
      width: 30em;
      padding-top: 3em;
    }
    input, label {
      float: left;
    }
    input {
      margin: 0 0 1em .2em;
      padding: .2em .5em;
      width: 65%;
      background-color: #fffbf0; 
      border: 1px solid #e7c157;  
    }
    label { 
      text-align: right;
      line-height: 1.5;
      width: 30%;
    }
    label::after {
      content: ": ";
    }
    button {
      margin-left: 30%;
    }
  </style>
  <title>Formular mit label + placeholder</title>	
</head>

<body>
  <h1>CSS-Beispiel: Formular mit label + placeholder</h1>
<main> 
  <form action="CSS_formular_2.html"> 
    <label for="name">Name</label> 
    <input id="name" placeholder="Max Mustermann">
     
    <label for="passwd">Passwort</label> 
    <input id="passwd" type="password" placeholder="Ihr Passwort"> 
    
    <button>anmelden</button>
  </form>
</main>  

</body>
</html>