2-13混合布局编程练习
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>混合布局2-13编程练习</title>
<style type="text/css">
body{margin:0;
padding:0;
}
.container{width:800px;
height:220px;
background:rgb(173,216,230);
margin:0 auto;
padding:10px 100px;
}
.image1{width:350px;
height:190px;
float:left;
margin-top:10px;}
.image2{width:350px;
height:190px;
float:right;
margin-top:10px;}
.footer{width:800px;
height:120px;
background:rgb(255,182,193);
margin:0 auto;
padding:10px 100px;
}
.left{width:200px;
height:100px;
float:left;
margin-right:100px;
margin-top:10px;}
.center{width:200px;
height:100px;
float:left;
margin-top:10px;
}
.center{width:200px;
height:100px;
float:right;
margin-top:10px;}
</style>
</head>
<body>
<div class="container">
<div class="image1">
<img src="http://img1.sycdn.imooc.com/climg//58c0f808000129a303600215.jpg" alt="image1" width="350px" height="190px"/>
</div>
<div class="image2">
<img src="http://img1.sycdn.imooc.com/climg//58c0f819000198a703600214.jpg" alt="image2" width="350px" height="190px"/>
</div>
</div>
<div class="footer">
<div class="left">
<img src="http://img1.sycdn.imooc.com/climg//58c0f81d0001fe4402000060.jpg" alt="image" width="200px" height="100px"/>
</div>
<div class="center">
<img src="http://img1.sycdn.imooc.com/climg//58c0f8220001dfce02000060.jpg" alt="image" width="200px" height="100px"/>
</div>
<div class="right">
<img src="http://img1.sycdn.imooc.com/climg//58c0f8780001c74602000060.jpg" alt="image" width="200px" height="100px"/>
</div>
</div>
</body>
</html>
可以运行一下吗,为啥粉色部分的第二张图片和其他两张距离外面盒子的高度不一样呢
正在回答

这里改成right,你的代码中写了两个center。注意要细心一点。祝学习愉快!
- 参与学习 人
- 提交作业 11218 份
- 解答问题 36712 个
从一个不会编程的小白到一个老司机是需要过程的,首先得入门,学习基础知识,然后才能进阶,最后再到精通,本专题是你走进前端世界的不二选择!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星