用css解决iframe的自适应问题(跨域下同样有用)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="">
<meta name="keywords" content="">
<title>aaa</title>  
<style>
html,body,#gameFrame{height:100%;width:100%;padding:0px;margin:0px;background-color:#000;} 
dl,dt,dd,p,em,h1,h2,h3,h4,h5,h6,input,textarea,ul,li{margin:0px; padding:0px;}
img{border:0}
</style>

</head>
<body>
<div id="gameFrame">
<iframe id="gamein" src="url" style="width:100%;height:100%;z-index:-100" frameborder="0" scrolling="auto"> </iframe>
</div> 

</body>
</html>

 

posted @ 2013-07-17 15:01  流星焱雨  阅读(348)  评论(0编辑  收藏  举报