By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,850 Members | 1,026 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,850 IT Pros & Developers. It's quick & easy.

extra vertical space WITHIN form

P: n/a
There are about a million posts on how to get rid of the extra space _after_ the
form end-tag, but I can't find any that solve my problem: extra space _in_ the
form tag.

I have a table nestled inside the form and since I want the submit button
underneath the input text field i have a br tag to separate them. For some
reason IE5.5 gives me what seems like two br tags. It looks good in Opera 7,
and in K-Meleon 0.6 (Gecko).
Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
mappo wrote:
There are about a million posts on how to get rid of the extra space _after_ the
form end-tag, but I can't find any that solve my problem: extra space _in_ the
form tag.
using css, by setting padding and margin.
I have a table nestled inside the form and since I want the submit button
underneath the input text field i have a br tag to separate them. For some
reason IE5.5 gives me what seems like two br tags. It looks good in Opera 7,
and in K-Meleon 0.6 (Gecko).


url?

--
Brian
follow the directions in my address to email me

Jul 20 '05 #2

P: n/a
> using css, by setting padding and margin.
I set margin bottom to 0, but that only helped between the form and the rest
of the page, not insode the form
url?

http://www.ing.umu.se/~id01mht/
Jul 20 '05 #3

P: n/a
You didn't quote much, so others might find this message a bit arcane.
Let's see if I can stick in some context:

url: http://www.ing.umu.se/~id01mht/

mappo wrote:
There are about a million posts on how to get rid of the extra
space _after_ the form end-tag, but I can't find any that solve my
problem: extra space _in_ the form tag.
using css, by setting padding and margin.


I set margin bottom to 0, but that only helped between the form and
the rest of the page, not insode the form


You can also set margins on input, textarea, etc.
I have a table nestled inside the form
No, you have forms nestled inside table cells.
and since I want the submit button underneath the input text
field i have a br tag to separate them.
You don't need the br element. Use display: block for input element.
Set margin: auto to center block level items. Since MSIE/Win
doesn't get this, also set text-align: center for from element.
For some reason IE5.5 gives me what seems like two br tags.


Sounds like a bug in IE 5.5.

I looked at your code. That's not tabular data. Don't use tables for
layout. And KISS (keep it simple, stupid).

/* css */

form {
text-align: center ; /* hack so MSIE centers */
float: left ;
width: 12em ;
}
input {
display: block ;
margin: auto ;
}

<!-- html -->
<form action="http://www.google.com/search" method="get" target="_blank">
<input type="Text" name="q" size="27" maxlength="255" value="">
<input type="submit" name="btnG" value="Google">
</form>
<form name="imdb" method=post action="http://www.imdb.com/Find"
target="_blank">
<input type=hidden name=select value="All">
<input type=text name="for" size="27">
<input type="submit" value="IMDb">
</form>
<form name="biblan"
action="http://katalog.bibliotek.umea.se/opac/sv/opac/main.asp"
method="get" id="sok_fritext" target="_blank">
<input type="text" name="TextFritext" size="27" maxlength="100"
value="">
<input type="submit" value="Ume&aring; St.bibl." id=submit1
name=submit1>
</form>
<!-- etc. -->
wfm, MSIE 5.0/Win. Also works in O7 and Moz 1.3. That's all you
need. You don't need the br element. And you don't need a table to
lay out the forms. And the code is much simpler. In fact, if it
weren't for the line wrapping, it'd be even prettier. :-)

BTW, lose the target="_blank" nonsense. Your users can figure out how
to open a new window if they want.

--
Brian
follow the directions in my address to email me

Jul 20 '05 #4

P: n/a
mappo wrote:

I set margin bottom to 0, but that only helped between the form and the rest
of the page, not insode the form
url?


http://www.ing.umu.se/~id01mht/


I just noticed that you didn't quote all of your attributes in the
form. You should. Note that I copied your form code from your page,
but didn't correct this (I didn't see it before posting my reply). If
you copy my code into your document, don't forget to fix this.

--
Brian
follow the directions in my address to email me

Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.