如果父div中,有2个子div是浮动的,父div的高度,有没有被子div撑起来?父div是多高?
没有被撑起,父div是原来的高度。
以下是实例
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Document</title>
<style>
#fu{
margin: 10px;
width: 500px;
height: 500px;
background: blue;
float: left;
}
</style>
</head>
<body>
<div id="fu">
</div>
</body>
</html>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Document</title>
<style>
#fu{
margin: 10px;
width: 500px;
height: 500px;
background: blue;
float: left;
}
.zi1{
width: 100px;
height: 100px;
background: yellow;
float: left;
margin: 10px;
}
</style>
</head>
<body>
<div id="fu">
<div class="zi1"></div>
<div class="zi1"></div>
</div>
</body>
</html>