2-13练习问题
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
*{
margin: 0;
padding: 0;
text-align: center;
}
html,body{
height: 100%;
width: 100%;
}
.container{
width: 100%;
height: 80%;
background: #B0E0E6;
position: relative;
}
.left{
width: 50%;
height: 100%;
float:left;
background: url(http://img1.sycdn.imooc.com/climg//58c0f808000129a303600215.jpg) no-repeat center center;
}
.right{
width: 50%;
height: 100%;
float:right;
background:url(http://img1.sycdn.imooc.com/climg//58c0f819000198a703600214.jpg) no-repeat center
center;
}
.bottom{
width: 100%;
height: 20%;
background: pink;
}
.img{
width: 33%;
height: 100%;
float: left;
}
.img1{
width: 100%;
height: 70%;
background: url(http://img1.sycdn.imooc.com/climg//58c0f81d0001fe4402000060.jpg) no-repeat center center;
}
.img2{
width: 100%;
height: 70%;
background: url(http://img1.sycdn.imooc.com/climg//58c0f8220001dfce02000060.jpg) no-repeat center center;
}
.img3{
width: 100%;
height: 70%;
background: url(http://img1.sycdn.imooc.com/climg//58c0f8780001c74602000060.jpg) no-repeat center center;
}
/*.text{
width: 100%;
height: 30%;
}*/
/*p{
position: relative;
left: 0px;
right: 0px;
}*/
/*.imgs{
display: inline-block;
position: relative;
left: 50%;
top: 50%;
margin-top:-30px;
margin-left: -375px;
}
img:nth-child(1){
margin-left: 0px;
}
img{
margin-left:80px;
}*/
</style>
</head>
<body>
<div class="container">
<div class="left"></div>
<div class="right"></div>
</div>
<div class="bottom">
<div class="img">
<div class="img1"></div>
<!-- <div class="text"> -->
<p>第一张图片</p>
<!-- </div> -->
</div>
<div class="img">
<div class="img2"></div>
<!-- <div class="text"> -->
<p>第二张图片</p>
<!-- </div> -->
</div>
<div class="img">
<div class="img3"></div>
<!-- <div class="text"> -->
<p>第三张图片</p>
<!-- </div> -->
</div>
<!-- <div class="img2"></div>
<div class="img3"></div> -->
<!-- <div class="imgs">
<img src="http://img1.sycdn.imooc.com/climg//58c0f81d0001fe4402000060.jpg">
<img src="http://img1.sycdn.imooc.com/climg//58c0f8220001dfce02000060.jpg">
<img src="http://img1.sycdn.imooc.com/climg//58c0f8780001c74602000060.jpg">
</div> -->
</div>
</body>
</html>
问题1、底部是三张图片,还是分三列做啊
2、怎么让p在图片下半部分垂直居中啊
正在回答 回答被采纳积分+1
- 参与学习 人
- 提交作业 11218 份
- 解答问题 36713 个
从一个不会编程的小白到一个老司机是需要过程的,首先得入门,学习基础知识,然后才能进阶,最后再到精通,本专题是你走进前端世界的不二选择!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星