Gernot Back: label und input vertikal zentrieren?

Beitrag lesen

Hallo nochmal Christian,

War es ungefähr das, was dir als Darstellung vorschwebte?

Dazu bedarf es keinerlei Floats und Block-Displays und auch keines Herumspielens an der Line-Height.

  
<html>  
<head>  
<title>vertical align</title>  
<meta name="author" content="Gernot">  
<meta name="generator" content="Ulli Meybohms HTML EDITOR">  
<style type="text/css">  
[code lang=css]  
input {  
       vertical-align:middle;  
       margin-left:3px;  
}  
  
label {  
      vertical-align:middle;  
      padding-left:5em;  
      background-color:yellow;  
}  

</style>
</head>
<body>
      <form name="myForm" action="#" method="post" >
            <label for="counter">Zähler:</label><input type="text" id="counter" name="counter" maxlength="8" size="8" />
      </form>
</body>
</html>
[/code]

Gruß Gernot