If you use label elements around your text then you can simply do this:
HTML:
<p><label for="firstName">First Name</label><input type="text" id="firstName"
/></p>
CSS:
form p{
clear:both;
}
form p label{
float:left;
width:30%;
}
Grant
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Darren Wood
Sent: Tuesday, 5 April 2005 12:35 PM
To: [email protected]
Subject: Re: [WSG] Styling Forms
[EMAIL PROTECTED] wrote:
> Good evening all,
>
> I know there's two schools of thought regarding forms where one uses a
> table and the other a definition list to style and layout the data fields.
>
> I have a simple form on a client's "Contact Us" page, and I wondered if
> there's a consensus as to which method is more semantically correct?
>
> Please advise...
>
There's a simple question I ask myself before I decide whether something
goes in a table or not, and that question is:
Is it tabular data?
In this case I'd have to say that a form is _not_ tabular data. Its
form data, and thus I'd try to make use of the tags designed to deal
with forms:
<form>
<fieldset>
<legend>
<label>
<input>
<textarea>
Hope that helps
Darren
******************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************
**********************************************************************
This message is intended for the addressee named and may contain
privileged information or confidential information or both. If you
are not the intended recipient please delete it and notify the sender.
**********************************************************************
******************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************