Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form closing tag takes up vertical space?

Status
Not open for further replies.

ESquared

Programmer
Dec 23, 2003
6,129
US
My </FORM> take is taking up space. How do I prevent that?

<DIV>
<FORM name="myform" action="action.asp" method="GET">
<INPUT name="q" id="q" type="text" maxlength="100" size="25">
<INPUT type="submit" value="Search">
</FORM>
</DIV>

This div is nested inside other divs. The </FORM> tag wraps to the next line after the button and creates a bunch of extra space that's breaking my layout.

If I put the DIVs inside the form entirely, then the </FORM> tag adds space somewhere else that I don't want. I can't find a place where it won't take up vertical space.

Any ideas?
 
Try....

Code:
<FORM name="myform" action="action.asp" method="GET" [!]style="padding:0; margin:0"[/!]>

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
To elaborate on George's correct reply. Form element puts some margin at the bottom by default. If you would like to not have a margin there, you need to cancel it out via CSS. For production code, it is best to then move the style declaration in a separate stylesheet.
 
I have my css all in a LINK REL.

Why on earth does a form closing tag have margins? That seems almost idiotic. It just doesn't seem structural. It's like the /HEAD tag having a margin--inexplicable. It is not even by rights a real physical container, but more of a way to signify which inputs are grouped together into a collection--these are this form and those are that form. At least that's the way I've always thought about it.

I tried "display: none" and it didn't do diddly squat. I will try 0 margins and see what happens.

Thanks for the ideas.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top