Forms without ugly whitespace
I have always struggled with a little html quirk when it comes to forms. I have several pages with small forms within them such as login boxes and subscription boxes. It's easy to put them in a page but I always find that there is this ugly whitespace above and below the form and I can't get rid of it !!!. How can I display these forms without the line breaks that form tags seem to automatically insert ??
zollet posted this at 00:35 — 8th February 2003.
He has: 1,016 posts
Joined: May 2002
Add this CSS code to your code....
<style type="text/css">
<!--
form {
margin: 0px;
padding: 0px;
}
-->
</style>
Busy posted this at 02:46 — 8th February 2003.
He has: 6,151 posts
Joined: May 2001
also depends where they are, ie tables, divs ...
If its simple table you can do something like
...
to validate in xhtml you need a div or something between the form tags as well
...
Renegade posted this at 08:49 — 8th February 2003.
He has: 3,022 posts
Joined: Oct 2002
You need DIVs in form tags for it to validate as XHTML? what for?
Busy posted this at 09:04 — 8th February 2003.
He has: 6,151 posts
Joined: May 2001
to make it validate
just one of the many stupid things you have to do these days. a blank (empty) div is all you need.
Suzanne posted this at 17:09 — 8th February 2003.
She has: 5,507 posts
Joined: Feb 2000
Actually (*ahem*) the point is to give the elements within a form structure, so the div is supposed to go AROUND them. If you use accessible forms, you will also use fieldset, and legend, and other fun elements. The form requires more intricate markup because of its function.
Busy posted this at 19:09 — 8th February 2003.
He has: 6,151 posts
Joined: May 2001
problem is some of the accessible form propertys aren't supported (silly oprea) while others only either support half of it or have their own method of supporting it.
Renegade posted this at 09:44 — 9th February 2003.
He has: 3,022 posts
Joined: Oct 2002
...man that sucks...
Suzanne posted this at 18:41 — 9th February 2003.
She has: 5,507 posts
Joined: Feb 2000
ah yes, welcome to 2003, where we have to admit that Jakob Nielsen was right. Bugger!
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.