2-13练习,老师帮忙看下代码,是否需要优化
来源:2-14 编程练习
Annisa
2018-06-01 23:29:15
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
/*此处写代码*/
*{
margin:0;
padding:0;
margin:0 auto;
text-align:center;
}
.container{
width: 1000px;
height: 600px;
}
.header{
width:100%;
height:400px;
background: #ADD8E6;
}
div.left1 img,div.right1 img{
width: 300px;
height:200px;
}
div.left1 img{
margin:100px 66.6px 100px 133.3px;
}
div.right1 img{
margin:100px 133.3px 100px 66.6px;
}
.left1{
width:50%;
height:100%;
float:left;
}
.right1{
width:50%;
height:100%;
float:right;
}
.footer{
width:100%;
height:200px;
background: #FFB6C1;
}
div.left2 img,div.center img,div.right2 img{
width: 200px;
height: 100px;
}
div.left2 img{
margin:50px 50px 50px 100px;
}
div.center img{
margin: 50px;
}
div.right2 img{
margin: 50px 100px 50px 50px;
}
.left2{
width:33%;
height: 100%;
float:left;
}
.center{
width:33%;
height: 100%;
float:left;
}
.right2{
width:33%;
height: 100%;
float:right;
}
</style>
</head>
<body>
<!-- 此处写代码 -->
<div class="container">
<div class=header>
<div class="left1">
<img src="http://climg.mukewang.com/58c0f808000129a303600215.jpg">
</div>
<div class="right1">
<img src="http://climg.mukewang.com/58c0f819000198a703600214.jpg">
</div>
</div>
<div class=footer>
<div class=left2>
<img src="http://climg.mukewang.com/58c0f81d0001fe4402000060.jpg">
</div>
<div class="center">
<img src="http://climg.mukewang.com/58c0f8220001dfce02000060.jpg">
</div>
<div class="right2">
<img src="http://climg.mukewang.com/58c0f8780001c74602000060.jpg">
</div>
</div>
</div>
</body>
</html>
1回答
代码书写没问题 不需要在优化了
相似问题