javascript - 轮播点击向右滚动,元素style,left已经改变了,但是图片还是没动
巴扎黑
巴扎黑 2017-04-11 10:57:49
[JavaScript讨论组]


    
*{
    margin: 0;
    padding: 0;
}
a{
    text-decoration: none;
    display: block;
}
li{
    list-style-type: none;
    float: left;
}
.banner-wrap{
    width: 984px;
    height: 209px;
     overflow: hidden; 

    margin: 0 auto;

    position: relative;

    
}
.banner-wrap img,.banner-wrap ul li{
    width: 984px;
    height: 209px;
}
.banner-wrap ul{
    width: 3936px;
    height: 209px;
    display: flex;
    flex-direction: row;
}

.banner-ctrl>a{
    position: absolute;

    top: 50%;
    transform: translateY(-20px);

    width: 20px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    color: #999;
    background-color: #333;
    opacity: 0.3;

}
.banner-wrap:hover > .banner-ctrl>a{
    opacity: 0.9;
}
.banner-ctrl .prev{
    left: 10px;
}
.banner-ctrl .next{
    right: 10px;
}
巴扎黑
巴扎黑

全部回复(1)
PHPz

是不是ul没有设置position:absolute?

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号