我的iframe有问题.我真的希望框架根据iframe中的内容自动调整高度.我真的想通过没有javascript的CSS来做到这一点.但是,如果我也有,我会使用javascript.
我试过height: 100%;和height: auto;,等我只是不知道什么尝试!
这是我的CSS.对于框架......
#frame {
position: relative;
overflow: hidden;
width: 860px;
height: 100%;
}
Run Code Online (Sandbox Code Playgroud)
然后是框架的页面.
#wrap {
float: left;
position: absolute;
overflow: hidden;
width: 780px;
height: 100%;
text-align: justify;
font-size: 16px;
color: #6BA070;
letter-spacing: 3px;
}
Run Code Online (Sandbox Code Playgroud)
页面的编码看起来像这样......
<!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" xml:lang="en" lang="en">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>...</title>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="header">
</div>
<div …Run Code Online (Sandbox Code Playgroud)