Welcome to WebmasterWorld Guest from 50.17.117.221

Forum Moderators: incrediBILL

Message Too Old, No Replies

why does firefox wrap on non breaking spaces?

     
1:37 pm on Jun 26, 2005 (gmt 0)

New User

10+ Year Member

joined:June 2, 2005
posts:2
votes: 0


I have the following HTML output, note the &nbsp between the link and the image:

<td><a href="javascript:__doPostBack('GrdProducts$_ctl2$_ctl4','')">Dlvry</a>&nbsp;<img src=images/sort_asc.gif width=8 height=9 align=absmiddle><br></td>

I have always understood nbsp to stand for non-breaking-space. Correct?

So why would firefox 1.0.4 render the image below the text? I don't care that the column width may not be wide enough to fit the image - it should still adhere to my instruction to place the image on the same line! Surely?

Can anyone shed some light on this?

5:22 pm on June 26, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
posts:7999
votes: 0


<td nowrap>

:-)

It is confusing. &nbsp; does indeed mean non-breaking space, but that's not what it does. As you know browsers collapse white space, a dozen white spaces equals one in display. But &nbsp; forces whitespaces, so &nbsp;&nbsp;&nbsp; forces three white spaces.

10:20 pm on June 27, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 18, 2003
posts:921
votes: 0


Non-breaking space translates as non-collapsing space.
It does not mean no-line-return-now space.

Since the nbsp won't shrink, and the image plus the nbsp doesn't fit side-by-side in the column you are forcing them onto seperate lines.

Don't confuse line-break with space-break!

12:10 am on June 28, 2005 (gmt 0)

New User

10+ Year Member

joined:June 2, 2005
posts:2
votes: 0


Thanks for the clarification. I was used to the way IE handled it, and assumed that was the correct way :(
2:29 pm on June 28, 2005 (gmt 0)

Full Member

10+ Year Member

joined:Feb 23, 2003
posts:207
votes: 0


Thanks for the clarification. I was used to the way IE handled it, and assumed that was the correct way :(

With differences, it is usually safe to assume that IE is handling it the incorrect way. ;)