老师这里我把左按钮left调成负数按钮就不见了,这是为啥?
css部分
.banner{
position: relative;
}
.banner img{
width: 100%;
}
.banner .center-wrap{
position: absolute;
width: 1152px;
height: 100%;
top: 0;
left: 50%;
margin-left:-576px;
}
.banner .left-btn{
position: absolute;
width: 28px;
height: 44px;
background:url(../images/icons.png) no-repeat -21px -94px;
left: 10px; // 调成-10px就看不见了
top: 50%;
margin-top: -22px;
}
.banner .left-btn:hover{
opacity: 0.8;
}
.banner .right-btn{
position: absolute;
width: 28px;
height: 44px;
/* 精灵技术先导入图片 */
background:url(../images/icons.png) no-repeat -21px -29px;
right: -38px;
top: 50%;
margin-top: -22px;
html部分
</header>
<section class="banner">
<!-- 图片为横幅 -->
<img src="images/banner1.jpg" alt="">
<div class="center-wrap">
<div class="right-btn" ></div>
<div class="left-btn" ></div>
<ul>
在这里输入代码,可通过选择【代码语言】突出显示
正在回答
同学你好,.clearfix这里如果不添加这个类名,一般是不会添加上隐藏样式的。
如果用的是vscode编辑器,可以在这里搜索一下,看看是哪部分设置了overflow属性
可以对照着看看,这样也好找一些。
如果还是找不到,建议可以先放放,按钮能够显示出来就好,学习后面的知识。
祝学习愉快!
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星