How to supress the automatic space between FORMs

If you stack forms on top of each other on an HTML page, you will notice that there is an automatic blank space inserted. This code will eliminate that space which will give you more freedom when designing a page with many separate forms.

   <title>form test</title>
   form {margin-top: -1em;}
<form method="POST" action="xxx">
Search here: <input type="text">
<input type="submit" value="search" name="B1">
<form method="POST" action="xxx">
Search there: <input type="text">
<input type="submit" value="search" name="B1">

You might also like...


Edward Tanguay Edward Tanguay updates his personal web site weekly with code, links, quotes and thoughts on web development. Sign up for the free newsletter.


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The generation of random numbers is too important to be left to chance.” - Robert R. Coveyou