/    Sign up×
Community /Pin to ProfileBookmark

Using CSS to line up forms

Hello. What is the best way to use CSS to make forms that are nicely lined up?
[url]http://www.barkleigh.com/petquest_07_request.html[/url] – This page uses tables to make the form, but is there a way to use CSS to achieve a similar affect? I have tried to use CSS to do it but have not been able to do it yet. Thanks.

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@KDLAFeb 15.2007 — I find floating the label works best, then containing that "row."

<i>
</i>#form label {width: 15em; text-align: left; float: left;}
#form .row {display: block; width: 100%; margin-top: 25px; margin-bottom: 25px; vertical-align: top; clear: left; font-size: .8em; }

<i>
</i>&lt;form id="form"&gt;
&lt;div class="row"&gt;
&lt;label for="firstname"&gt;Your First Name:&lt;/label&gt;
&lt;input name="firstname" id="firstname" type="text" value="Your First Name" size="35" /&gt;
&lt;/div&gt;
&lt;/form&gt;
×

Success!

Help @bp_travis spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...