Leser: 14
1 2 3 4 5
<label for="a">Text</label> <input type="text" id="a" name="a" /> <label for="b">Text2</label> <textarea id="b" name="b"></textarea>
2009-07-12T12:43:11 Linuxer1. Gedanke: ein BR-Tag zwischen "label" und "input" setzen ;o)
2. Gedanke: label mit CSS 'display: block;' formatieren; kann allerdings das Design verändern ;o)
1
2
<label>1</label><label>2</label><br/>
<input type="text" id="a" name="a" /><textarea id="b" name="b"></textarea>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<html>
<head>
<title>vertical align</title>
<meta name="author" content="Gernot">
<meta name="generator" content="Ulli Meybohms HTML EDITOR">
<style type="text/css">
input {
margin-left:3px;
}
label {
display: block;
background-color:yellow;
}
.inlineBlock { display: inline-block; width: 7em; }
form#myForm div {
display: inline-block;
width: 7em;
background-color: blue;
}
form#myForm div#counter {
display: inline-block;
width: 12em;
background-color: blue;
}
</style>
</head>
<body>
<form name="myForm" id="myForm" action="#" method="post" >
<div id="counter">
<label for="counter">Zähler:</label>
<input type="text" id="counter" name="counter" maxlength="8" size="8" />
</div>
<div>
<label for="counter2">Zähler2:</label>
<input type="text" id="counter2" name="counter2" maxlength="8" size="8" />
</div>
<div>
<label for="counter3">Zähler3:</label>
<input type="text" id="counter3" name="counter3" maxlength="8" size="8" />
</div>
</form>
</body>
</html>