`
citygu
  • 浏览: 26871 次
  • 性别: Icon_minigender_1
  • 来自: CZ
社区版块
存档分类
最新评论

xhtml iframe 百分比自适应

阅读更多
以前用惯了<iframe src="" height="100%" width="100%">今天突然不行了。郁闷的了半天。我是前台web的菜鸟。
上面这种写法在html4.01里面是可以的.xhtml就不行了。
下面附上xhtml里面的自适应写法。
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
 <head>
  <title>iframe example</title>
  <style type="text/css">
   html, body, div, iframe { margin:0; padding:0; height:100%; }
   iframe { display:block; width:100%; border:none; }
  </style>
 </head>
 <body>
  <div>
   <iframe src="http://example.org/">
    <p><a href="http://example.org/">example.org</a></p>
   </iframe>
  </div>
 </body>
</html>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics