普通与普通大者取大
<!DOCTYPE html>
<html>
<head>
<title>box test</title>
<style type="text/css">
#box{
width: 200px;
height: 200px;
background: black;
margin-bottom: 50px;
}
#box1{
width: 300px;
height: 100px;
background: blue;
margin-top: 50px;
}
</style>
</head>
<body>
<div id="box"></div>
<div id="box1"></div>
</body>
</html>
float 与 float两者相加
<!DOCTYPE html>
<html>
<head>
<title>box test</title>
<style type="text/css">
#box{
width: 200px;
height: 200px;
background: black;
margin-bottom: 50px;
float: left;
}
#box1{
width: 1900px;
height: 100px;
background: blue;
margin-top: 50px;
float: left;
}
</style>
</head>
<body>
<div id="box"></div>
<div id="box1"></div>
</body>
</html>
float对普通无影响
<!DOCTYPE html>
<html>
<head>
<title>box test</title>
<style type="text/css">
#box{
width: 200px;
height: 200px;
background: black;
margin-bottom: 50px;
float: left;
}
#box1{
width: 300px;
height: 100px;
background: blue;
margin-top: 50px;
float: left;
}
#box2{
background: green;
height: 300px;
width: 1800px;
}
</style>
</head>
<body>
<div id="box"></div>
<div id="box1"></div>
<div id="box2"></div>
</body>
</html>
总结:普通对普通大者取大;
float与普通无影响;
float与float两者相加