请问老师,2-13代码帮忙看看能否优化?
来源:3-1 圣杯布局
Snikt
2017-07-18 23:28:24
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
/*此处写代码*/
*{padding:0;margin:0;}
.content{
width:90%;
height:400px;
margin:auto auto;
background:#000;
position:absolute;
top:0;
bottom:0;
left:0;
right:0;
}
.top{
width:100%;
height:280px;
background:#add8e6;
}
.top-left{
width:40%;
float:left;
text-align:center;
margin-left:10%;
padding-top:31px;
}
.top-right{
width:40%;
float:right;
text-align:center;
margin-right:10%;
padding-top:31px;
}
.bottom{
width:100%;
background:#ffb6c1;
height:120px;
}
.bot-left{
width:30%;
float:left;
text-align: center;
padding-top:30px;
margin-left:5%;
}
.bot-middle{
width:30%;
float:left;
text-align: center;
padding-top:30px;
}
.bot-right{
width:30%;
float:right;
text-align: center;
margin-right:5%;
padding-top:30px;
}
</style>
</head>
<body>
<!-- 此处写代码 -->
<div class="content">
<div class="top">
<div class="top-left">
<img src="http://climg.mukewang.com/58c0f808000129a303600215.jpg" >
</div>
<div class="top-right">
<img src="http://climg.mukewang.com/58c0f819000198a703600214.jpg">
</div>
</div>
<div class="bottom">
<div class="bot-left">
<img src="http://climg.mukewang.com/58c0f81d0001fe4402000060.jpg">
</div>
<div class="bot-middle">
<img src="http://climg.mukewang.com/58c0f8220001dfce02000060.jpg">
</div>
<div class="bot-right">
<img src="http://climg.mukewang.com/58c0f8780001c74602000060.jpg">
</div>
</div>
</div>
</body>
</html>
1回答
思路清晰,布局写的挺好的,基本上已经是最简洁的了,编码是灵活的,没有什么固定的模式,以后还是要看具体的需求来做,能够灵活的编码最重要。相信自己,继续加油!
相似问题
回答 1