Forum Moderators: open

Message Too Old, No Replies

IFrame width

Netscape/Mozilla make my iframes wider than they are set to be

         

barnumyay

5:25 am on Feb 24, 2004 (gmt 0)

10+ Year Member



I've searched these forums and I know there have been many qestions about netscape's relation to iframes so i'm sorry if i'm being repetitive but I haven't found an adequate reply to my personal situation yet.

I'm currently designing a site which will employ an iframe in a sort of menu function. The problem is that my design is image intensive and really requires some things to be of exact size. Here's the code i'm using for my iframe:

<TD WIDTH=281 HEIGHT=321 BGCOLOR=#FFFFFF><iframe src="http://www.sordeo.com/features.html" width="281px" height="321px">If you are seeing this message, then your browser does not support internal frames, for this site to display properly, it must.</iframe></TD>

The real problem is that Mozilla and netscape make the iframe to be about 283/284 pixels in width (instead of the set 281), which causes my page to turn out really poor and things to not fit together properly.

There may be some replies to the effect of, "well, stop using iframes then". I know they can be considered poor style sometimes but for this particular page and it's particular use, I don't see a way around it.

How do I change it so it displays at 281 pixels in width. There was a suggestion in another thread about using ilayers which then causes links in the iframe to no matter what open in a new window, and that i'd really like to avoid doing as well.

tombola

9:03 am on Feb 24, 2004 (gmt 0)

10+ Year Member



Welcome to Webmasterworld, barnumyay!

There were numerous threads about (poor) Netscape support for iframes.
Just click the link below for all messages on Webmasterworld that contain "netscape" and "iframe".

Search Webmasterworld: netscape+iframe [google.com]

isitreal

6:38 pm on Feb 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



when you set your iframe height and width, don't use the px like you did, those are only used in style declarations, they need to say width="381" or whatever, not width="381px". See if that helps.

Personally, I use a lot of frames and iframes and have had no problem with sizing them in Mozilla, opera, or any other iframe supporting browser.

If you want them to fit in the td, just set the iframe height and width at 100%, like width="100%", then it should just expand to fill its container, although you might have to declare an explicit CSS style for the container, like position:relative to make sure that the iframe knows what its container is, but try it the first way, don't size the iframe, size its container, then set the iframe to fill it with % values.

barnumyay

5:40 am on Feb 25, 2004 (gmt 0)

10+ Year Member



thank you so much isitreal...setting the the table cell's width and then the iframes to 100% worked perfectly...thanks...

isitreal

6:38 am on Feb 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Good, that's how I do it and I've never had any problem with iframe sizing.