设置浮动使两个div并排
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style type="text/css">
#dd{
width: 1000px;
height: 500px;
}
#one{
width: 500px;
height: 500px;
float: left;
background: bisque;
}
#two{
background: darkgray;
width: 500px;
height: 500px;
float: right;
}
input{
width: 200px;
height: 150px;
font-size: 50px;
}
</style>
</head>
<body>
<div id="dd">
<div id="one">
</div>
<div id="two">
</div>
</div>
</body>
</html>
关键代码:float:(left,right)