掉线宝宝
2015-01-21 10:02
有没有大神教一下怎么让box1和box2并排在一起而不是上下排列
float即可,不要把div转成块元素,在IE6 7 下 不认识 块元素的 inline-block转换。
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>边距</title>
<style type="text/css">
div{
width:300px;
height:300px;
border:1px solid red;
}
#box1,#box2{
display:inline-block;
}
</style>
</head>
<body>
<div id="box1">box1</div>
<div id="box2">box2</div>
</body>
</html>并排效果
float 或者 把box1和box2 设成 inline-block
初识HTML(5)+CSS(3)
1230047 学习 · 19084 问题
相似问题