+ -
当前位置:首页 → 问答吧 → iframe代码,ie里显示居中,ff里显示靠左,如何让ff居中显示?

iframe代码,ie里显示居中,ff里显示靠左,如何让ff居中显示?

时间:2008-06-07

来源:互联网


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <body> <iframe name=top src=top.html width=728 height=117 align="center" scrolling="no" frameborder="0"></iframe> <table align="center" width="728" height="927" border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="top"><iframe name=left src=index_left.html width=208 height=927 align="center" scrolling="no" frameborder="0"></iframe></td> <td valign="top" ><iframe name=right src=index_right.html width=520 height=927 align="center" scrolling="no" frameborder="0"></iframe></td> </tr> </table> <iframe name=bottom src=bottom.html width=728 height=150 align="center" scrolling="no" frameborder="0"></iframe> </body> </html>
 提示:您可以先修改部分代码再运行
[ 本帖最后由 sailershen 于 2008-6-7 16:56 编辑 ]

作者: sailershen   发布时间: 2008-06-07

iframe的话你应该加上style="display:block;margin:0 auto;"

作者: phantom   发布时间: 2008-06-08

谢谢版主,上下两个ifrmae加了你给的style以后的确居中了,我在中间的<table>语句里也加上,table也居中了。
非常感谢。

作者: sailershen   发布时间: 2008-06-09

今天我也在找这个解决方法,谢谢楼主。救我真及时啊!

作者: aftertaste   发布时间: 2011-03-02