>>>> Oops, always double check in IE! IE has a default bottom margin on
>>>> forms, so add a third rule to line up buttons
[quoted text clipped - 61 lines]
>> But then again, if your button were arranged vertically would that be a
>> crisis?
<snip signature>
> they are side by side but one aligned right and the other left ...
> I used margin on the input but in pixels. I think it will be hard to
> be sure that they do not overlap if the button text is defined in em.
> At the same time, this web site has localization and the inputs width
> might differ according to the language.
Well there is where you problem is. Pixels lock the design so if
anything changes, including the font, you have a problem. Also if you
compare my layout above with yours below, mine uses a wrapper div that
is relative position so it will define the dimensions of first form.
Then the canceling form it positioned absolutely from the *lower right
hand* corner of that rectangle. It does not matter what the font size or
even if you add or remove controls, cancel will always be in the lower
right hand corner of the first form.
Now with yours you are locating the canceling form with a absolute
*offset* in PIXELS! Change anything and now your cancel button is in the
wrong place. Is that that important that the cancel but be just to the
right of the submit? Having the submit align with the left of the form
and cancel to the right looks good and symmetrical.
If you really MUST have cancel the just of submit then position the
canceling form offset from the *lower left hand corner* of the first
form. But you must know with width of the width of the submit button
first hand and in ems not pxs for this to work.
This submit button is about 6.25em so if I add 1em for the gap I get
7.25em which I will use for the 'left' property. But by doing it this
way if you change the submit button's text you have to recalculate your
offset! I think lining it up with the right of the form is more
flexible, looks good, and being lazy much easier to maintain.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html;
charset=iso-8859-1">
<meta http-equiv="content-language" content="en-us">
<title>One Way</title>
<style type="text/css">
div.wrapper { position: relative; min-width: 15em; width: 800px;}
/* left offset 6.25em for submit + 1em for gap */
form.nogo { position: absolute; bottom: 0; left: 7.25em; }
div.wrapper form { margin: 0; }
</style>
</head>
<body>
<div class="wrapper">
<form action="someScript.php">
<fieldset>
<label for="foo">FOO: </label>
<input type="text" name="foo" id="foo" size="30">
</fieldset>
<fieldset>
<label for="bar">BAR: </label>
<input type="text" name="bar" id="bar" size="30">
</fieldset>
<fieldset>
<label for="bar">BAZ: </label>
<input type="text" name="baz" id="baz" size="30">
</fieldset>
<div>
<input type="submit">
</div>
</form>
<form action="someOtherPage" class="nogo">
<div>
<input type="submit" value="Cancel...">
</div>
</form>
</div>
</body>
</html>
> I would prefer having them on the top of each other.
On top of each other? You mean on above the other, not overlaid right?
[SUMMIT]
[CANCEL]
Sure don't do any positioning of the canceling for and you will get that
layout.
> Anyway, maybe I will use a button with type="button" even if I need to
> get dependent on javascript to redirect to a new url.
But that is a problem. About 10% of users have JavaScript disable and
that would make your form JavaScript *dependent*. If JavaScript is
disable then when the users tries to cancel the form is going to falsely
submit! Don't do it!

Signature
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com