PDA

View Full Version : Centering IFRAMES in Netscape 7


spinweb
01-27-2003, 08:45 PM
I'm using IFRAMES on my site and Internet Explorer either centers them by default, or is understanding the align attribute I have in my code. Unfortunately, Netscape 7 does not. Does anyone know how to get N7 to center an IFRAME?

Code below....

Thanks! Rick

/Specify display mode (0 or 1)
//0 causes document to be displayed in an inline frame, while 1 in a new browser window
var displaymode=0
//if displaymode=0, configure inline frame attributes (ie: dimensions, intial document shown
var iframecode='<iframe id="external" align="center" frameborder="0" name=MyIframe style="width:847px;height:810px" src="dlshome.html"></iframe>'

/////NO NEED TO EDIT BELOW HERE////////////

jkd
01-27-2003, 10:28 PM
iframe {
margin: 0 auto;
}

spinweb
01-28-2003, 03:42 AM
Probably a dumb question, but where does that go?

:p

spinweb
01-28-2003, 01:13 PM
I pasted the style in the head of the main file and in the called frame and still the IFRAME is left justified in Netscape 7.

??

zoobie
05-18-2003, 07:44 AM
You have to use css in either a <p> or <div> tag:

<p style="text-align:center"><iframe></iframe></p>

Closing the <p> tag is optional :cool:

Roy Sinclair
05-19-2003, 06:55 PM
Originally posted by zoobie
You have to use css in either a <p> or <div> tag:

<p style="text-align:center"><iframe></iframe></p>

Closing the <p> tag is optional :cool:

It's not optional in the current standard (xHTML 1), it's best to stop learning/teaching the bad habits of HTML past.