PDA

View Full Version : <form method=post> causing new line!


Taylor_1978
06-08-2004, 05:45 PM
Hi All...

When I start a form, using <form method="post">, why does it start a new line. So if I start this at the top of my page, it leaves line space before any input fields, and then again when I close with </form> - Why is this so? And how do I stop it?

Thanks in advance! :thumbsup:

Taylor!

bradyj
06-08-2004, 06:05 PM
it usually is because the form element is a 'block' level element -- just like a header, it makes a space at the top and bottom by default. To override, use some CSS:

form {margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px;}


The zeros go in this manner, respectively:
top right bottom left

If you notice that this doesn't fix it, make the top and bottom padding (or margin, test what works best) a -10px or another number that seems best for you.

Another test that may work is:

form {display: inline;}


But I am not sure how well this will work, I've not tried it. :)