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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FORM tag causes line break in Netscape 7.0 1

Status
Not open for further replies.

Craftor

Programmer
Feb 1, 2001
420
NZ
Hi all,

I'm encountering a horrible problem with Netscape 7.0 with a line break occurring before a <form> tag.

I've got the following HTML:
Code:
<span class="toptoolbar">
	<a href="/search/sitemap.aspx" class="toollink">Site map</a> | <a href="/contact/default.aspx" class="toollink">Contact us</a> | </span>
<form id="frmSearch" method="post" action="/search/default.aspx" style="display: inline; margin: 0px 0px 0px 0px; padding: 0px; white-space: nowrap";>
	<input type="text" style="font-size: 10px; vertical-align: middle;" id="txtSearch" name="txtSearch" runat="server" value="Search" /> 
	<input type="image" alt="Search" src="/layout/images/header/btn-go.gif" id="btnGo" style="vertical-align: middle" /> 
</form>

The line break occurs just after the second '|'.

As you can see, I've tried setting the padding, margins and display styles but nothing seems to work unfortunately. I really don't want to go the tables route as the site is currently built up with CSS.

Can anyone help with this please?

Thanks as always

Craftor
:cool:
 
Could it be that the span "toptoolbar" is creating the gap and not the form? Although N7 is an outdated browser (last update was in August 2004 and currently N9 is becoming a discontinued browser as well), it should still honour your style settings and should not create a new line. That's why I suspect some other element to be at fault.

Alternatively, I would use a list to create your menu and wrap the form around the entire list. There is nothing wrong with the first links being included in the form as well.

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
Well, the FORM element use to have those problems..
A workaround can be to set the display to "inline", margin to "0" and if it doesn't work, also set the float to "left". I would put all the code inside the FORM tags, this would erase the problem easy..

- Lowet

[gray]Why can't all browsers parse pages the same way? It should be the Web designer who decides how to display the content, not the browser![/gray]
 
Thanks for both your responses - Vragabond I don't think the span that's causing the break - it just sets the color of the elements in it :
Code:
.toptoolbar
{
	color: #999999;
}
Lowet - I tried applying the style elements to the form tag but still got the line break so I've just included all of the elements in the span tag within the form tag now - that's sorted the problem.

Thanks as always


Craftor
:cool:
 
Good to hear that you got it right. You know FORM elements use to add a line-break before, just like the P paragraph. I think it's a stupid rule but that's the way it is.. LOL

- Lowet

[gray]Why can't all browsers parse pages the same way? It should be the Web designer who decides how to display the content, not the browser![/gray]
 
Good, so you did exactly what I said. I just hope you did not put form inside the span, as span is an inline element and form is a block level one and the result would be invalid code.

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top