Forum Moderators: open

Message Too Old, No Replies

Image 'align left' problem in Netscape

         

Jon_King

2:35 pm on Mar 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm having a problem with the align left in the code below only in Netscape.

<img src="images/flower-table-fountain.jpg" width="180" height="280" hspace="10" align="left">
-----------------------------------------------------------

I have a image in a table with some text that 'flows' around the image using left align in the image tag.

In Netscape the "align=left" is causing the table to display wider that it's defined width. If I remove the align the table displays at proper width.

This table with image and text displays as expected in IE and Opera.

Any thoughts on this?

tedster

5:39 pm on Mar 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Browsers are not required to hold rigidly to defined widths when they render tables. The W3C spec says that browsers are allowed some "give" in rendering the content. This little freedom is essential to a browser, or else you could easily write code that created impossible constraints for the rendering engine. It would be Crash City

When you float an image to the left of text, the browser has shorter lines to use for rendering the text that wraps to the right of the image. Whatever rules a browser has in its internal code for when to generate a line break, they do not say "always break before the text goes beyond this width". Sometimes a word will be rendered on the same line as the previous word, even though this extends the containing cell beyond your declared width - and I'd bet this is what you're seeing.

For instance, you may have a 12-letter word and 11 of those letters make it in under the decalred width. Many browsers will keep that word on the smae line rather than create a big "hole" by doing strict wrapping.

Jon_King

6:02 pm on Mar 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Tedster,

I've sticked you a page that displays correctly and one that does not. I know there must a problem with the way I've designed the center table... I think.

Do you know of a way around this problem?

Jon

DrDoc

7:27 pm on Mar 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are we talking about NN$ or 6?

tedster

7:36 pm on Mar 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The problem appears in both NN6 and 7 - but wait, there is an unclosed tag that might be contributing to the browser's challenge.

Don't fret about rendering problems until you know the code validates. In this case, I'm not sure the change will make the difference, but let's wait and see how Jon_King fares.

Jon_King

12:52 pm on Mar 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I validated the doc with no change so then I eliminated each page element until finding the offender.

It is a javscript Dreamweaver rollover image:

<p align="center" class="content"><a href="http://www.widgets.com/items.asp?Cc=HENRI" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image125','','images/widgets-1b.gif',1)"><img src="images/widgets-1a.gif" name="Image125" width="256" height="96" border="0"></a></p>

If I move this image rollover to a different table no problem. I don't believe there is anything wrong with this script so there must be problem somewhere 'upstream' of the problem table.

thanks...
Bleary eyed