mo*****@yahoo.c om wrote:
How do I get a label to be on top of a text field?
Layout is basically a matter of CSS, not HTML. This is c.i.w.a.html, not
c.i.w.a.stylesh eets. Admittedly, you _could_ do some simple layout in
HTML, and, somewhat debatably, this is also about structure.
<label>Login:<i nput type="text" name="login"></label>
<label>Password :<input type="password" name="password" ></label>
generates this...
Login:textbox Password:textbo x
I want...
Login: Password:
textbox textbox
That would break users' expectations. That's not the way things are
commonly presented. Besides, it would confuse people who use simple
speech-based user agents that read line by line and ignore <label> markup.
What you _should_ want is
Login: textbox
Password: textbox
and a way to achieve this is
<form action="..." method="post">
<table>
<tr><td><labe l for="username"> Login</label>:</td>
<td><input id="username" type="text" name="login"></td></tr>
<tr><td><labe l for="pwd">Passw ord</label>:</td>
<td><input id="pwd" type="text" name="password" ></td></tr>
</table>
</form>
If you really want the layout you describe, the table approach can be
used with obvious modifications.