一只斗牛犬
2019-03-08 18:15:57
想把整個(gè)swiper-container置于距窗口底部30px,但設(shè)置bottom無(wú)效,高手請(qǐng)賜教<html> <head> <meta charset="utf-8" /> <link rel="stylesheet" href="http://www.swiper.com.cn/dist/css/swiper.min.css" /> <style> body { font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 14px; color:#000; margin: 0; padding: 0; } .swiper-container { width:100%; height:100%; max-width:580px; } .swiper-slide { background-position: center; background-size: cover; width: 100px; height:100px; } </style> </head> <body> <div class="swiper-container"> <div class="swiper-wrapper"> <div class="swiper-slide" style="background-color:red"></div> <div class="swiper-slide" style="background-color:blue"></div> <div class="swiper-slide" style="background-color:green"></div> <div class="swiper-slide" style="background-color:gray"></div> </div> </div> </body></html>
3 回答

MYYA
TA貢獻(xiàn)1868條經(jīng)驗(yàn) 獲得超4個(gè)贊
.swiper-container {
height:100px;
max-width:580px;
position: fixed;
bottom: 30px;
left: 50%;
transform: translate(-50%);
}

揚(yáng)帆大魚(yú)
TA貢獻(xiàn)1799條經(jīng)驗(yàn) 獲得超9個(gè)贊
.swiper-container {
width: 100%;
height: 100%;
max-width: 580px;
position: absolute;
bottom: 30px;
}
添加回答
舉報(bào)
0/150
提交
取消