插入一个整体DIV ,在其中插入三个DIV,应用CSS进行设置,使三个DIV呈水平排列,求大神帮忙
<html>
<head>
<style>
body{
margin:0;
padding:0;
}
.main{
float:left;
margin-left:10%;
width:80%;
margin-top:2%;
background-color:#ddd;
height:550px;
text-align:center;
}
.sub{
float:left;
background-color:#999;
margin-top:2%;
margin-left:2.5%;
width:30%;
height:300px;
text-align:center;
}
</style>
</head>
<body>
<div class="main">
<h1>我是第主DIV</h1>
<div class="sub">
<h2>我是内部DIV1</h2>
</div>
<div class="sub"><h2>我是内部DIV2</h2></div>
<div class="sub"><h2>我是内部DIV3</h2></div>
</div>
</body>
<script>
</script>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Narcissistic Number</title>
</head>
<style>
.warp {
width: 500px;
height: 300px;
border: 1px solid #69f;
margin: 0 auto;
}
.div {
width: 150px;
height: 200px;
background-color: #69f;
float: left;
margin: 0 8px;
}
</style>
<body>
<div class="warp">
<div class="div"></div>
<div class="div"></div>
<div class="div"></div>
</div>
</body>
</html>
谢谢你啦!可惜没有截图,我采纳楼上的了,难为你帮我做了我还没有采纳,不好意思。不过还是很感激你的,麻烦了!
没事