Three column forms with CSS

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Hello all,

I am trying my best to create a three column form using CSS but am
having no luck. It looks fine in Firefox but is mangled in IE. Here is
my best attempt:

<style type="text/css">

    font-family: arial;

  input[type="checkbox"] {
     margin-left: 1em;
     margin-right: 1em;
     margin-bottom: .5em;
     width: 5%;
     float: left;
     clear: left;

  label {
    text-align: left;
    margin-right: 0.5em;
    margin-bottom: .5em;
    width: 40%;
    float: left;

   input[type="text"] {
    float: left;
    margin-bottom: .5em;


<form action="/cgi-admin/" method="post">

        <input type="checkbox" name="itemmembership-1yr" value="yes"
        <label for="itemmembership-1yr">Standard Membership</label>
        <input type="text" name="amtmembership-1yr" value="99.00"
        <input type="checkbox" name="itemstudent-1yr" value="yes"
        <label for="itemstudent-1yr">Student Membership</label>
        <input type="text" name="amtstudent-1yr" value="49.00"
<input type="submit" name="op" value="Enter Payment" />

Pretty simple as you can see.

Can anyone tell me how to get a proper three column css form layout
that works in IE and Firefox? Everything I can find on the internets is
for two column layouts.

Derek Basch

Re: Three column forms with CSS

In our last episode,
talented dbasch broadcast on comp.infosystems.www.authoring.html:

Quoted text here. Click to load it

Check out "skidoo too"

Stuff still breaks in IE, but it is the usual stuff related to
spaces around LI, not the three column part.  The basic idea is
that the central column has huge right and left margins and you
put the two other columns on the margins.  It has the advantage
that the central column (which typically is the main the content)
comes first, so there aren't tons of navigation crap at the top
of the page as view by text browsers or robots (spiders).

Lars Eighner     < <
            Nobody has ever, ever, EVER learned all of WordPerfect.

Re: Three column forms with CSS

Scripsit dbasch:

Quoted text here. Click to load it

So why do you post here and not c.i.w.a.stylesheets?

Actually, your question _should_ have been "how do I mark up such-and-such a
form in HTML?" (to be solved before you consider the rendering problem), and
_then_ it would have belonged here. But you should have specified what
such-and-such is and posted the _URL_ of the best effort so far.

Quoted text here. Click to load it

No, it's just a fragment. Post the URL.

Quoted text here. Click to load it

You won't get much of a browser coverage with that.

Quoted text here. Click to load it

So what happens when I copy your page (adding a suitable <base href...> tag)
and edit the above element, changing "99.00" to "0.00" for example, and
submit the order? The point is that you should make the prices visible on
the page as normal text (not fields) and map the order type to a price _on
the server_. (And, of course, the prices should appear with currency unit
names, symbols, or abbreviations, such as "$". After all, this _is_ the
World Wide Web.)

Quoted text here. Click to load it

Not really. Are you using checkboxes, instead of radio buttons,
intentionally to make some people submit duplicate subscriptions (paying
both normal and student price), or didn't you just know about radio buttons?

Quoted text here. Click to load it

Your form content looks very much like a simple table, with controls (<input
...>) in one column, corresponding labels in another column, and price
information for the choice in the third column. If you use a <table> element
for it, the layout problem almost solves itself in a puff of logic, though
you will have some minor CSS issues to deal with in order to make the
appearance optimal.

Jukka K. Korpela ("Yucca")

Site Timeline