Beispiel:HTML input-Element5.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" 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>Pflichtfelder mit required</title>	
</head>

<body>
  <h1>CSS-Beispiel: Pflichtfelder mit required</h1>
<main> 
  <form>
    <label for="email">Email-Adresse</label>
    <input id="email" required>
 
    <label for="passwd">Passwort</label>
    <input type="password" id="passwd" required>
 
    <button type="submit">anmelden</button>
  </form>
</main>  

</body>
</html>