62,041
社区成员
发帖
与我相关
我的任务
分享
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
window.onload=function()
{
var bh = document.getElementById("B").offsetHeight;
if(bh>200)
{
document.getElementById("A").style.height=bh;
}
}
</script>
</head>
<style type="text/css">
*{
margin:0;
}
#A
{
width:100px;
float:left;
height:200px;
background:#cf9;
}
#B
{
margin-left:100px;
height:200px;
background:#ffa;
}
</style>
<body>
<div id="A">A</div>
<div id="B">B</div>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<style type="text/css">
.A{
width:100%;
height:25px;
line-height:25px;
BACKGROUND: #9ff;
}
</style>
<body>
<div class="A" align="center">asdfsadfasdfasdfsd</div>
</body>
</html>