twitter bootstrap custom carousel indicators

China☆狼群 提交于 2019-12-01 06:24:18

You could use media query -

@media screen and (max-width:480px) {
     .carousel-indicators li{
        background: url(images/triangle.png) no-repeat;
        background-size:120px 60px;
        width:120px;
        height:60px;
        cursor: pointer;
        text-align:center;
    }

It's collapsing because the width of your carousel-indicator is 320px. You can't have fixed with if you also want your code to be responsive on mobile. You can substitute percentage rather than using a fixed width

.carousel-indicators li{
    background: url(images/triangle.png) no-repeat;
    max-width:25%;
    max-height:15%; /*or any other percentage that would look good*/
    cursor: pointer;
    text-align:center;
}

Note that I used max-height and max-height so that I could keep the proportion of the image so it doesn't get stretched out in either direction.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!