老师 请帮忙检查

来源:4-3 编程练习

慕神8387157

2019-04-26 11:44:58

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>Document</title>

<style type="text/css">

.content{

width: 100%;

height:1200px;

background: url("http://climg.mukewang.com/59c9f7ce0001839219034033.png");

}

.left{

width: 100%;

height: 100%;

background: url("http://climg.mukewang.com/5a3383c70001f1b702240364.png") no-repeat left center;

position: fixed;

}

.right{

width: 100%;

height: 100%;

background: url(http://climg.mukewang.com/5a3383d00001a3dd02240364.png) no-repeat right center;

position: fixed;

}

</style>

</head>

<body>

<div class="content">

<div class="left"></div>

<div class="right"></div>

</div>

</body>

</html>


写回答

1回答

好帮手慕糖

2019-04-26

同学你好,1、建议:可以使用通配符去除左右的外边距。例:

http://img.mukewang.com/climg/5cc2a2a50001a0f702690143.jpg

2、这样的效果是实现了,不过若是在项目开发过程中,左右这个小盒子的宽高都设置100%,则会这个主题部分,因为宽高都是100%,直接遮盖上了哦,不建议这里操作,可以给左右的盒子都设置固定的宽高,然后设置垂直居中,以左边为例,例:

http://img.mukewang.com/climg/5cc2a36d0001de3b04290437.jpg

希望能帮助到你,祝学习愉快!

0

0 学习 · 40143 问题

查看课程