求助,我的banner不是100%宽,我想让它居中,请教怎么改?

1500次浏览 更新日期:2021-01-27 15:28:47 分类:问题求助 评论:1

求助,我的banner不是100%宽,我想让它居中,请教怎么改?

求助,我的banner不是100%宽,我想让它居中,请教怎么改?

html是这些____________________________________


<div class="aad clearfix wow slideInDown">

<div id="owl-demo" class="owl-carousel">

    {m:banner field="image" limit="5"}

    {loop $data $v}

<div class="item">

<img src="{$v[image]}" />

</div>

{/loop}

</div>

</div>


CSS是这些____________________________________


/* display none until init */

.owl-carousel{

    display: none;

    position: relative;

    width: 100%;

    -ms-touch-action: pan-y;

    max-width: 1280px;

}

.owl-carousel .owl-wrapper{

display: none;

position: relative;

-webkit-transform: translate3d(0px, 0px, 0px);

}

.owl-carousel .owl-wrapper-outer{

overflow: hidden;

position: relative;

width: 100%;

}

.owl-carousel .owl-wrapper-outer.autoHeight{

-webkit-transition: height 500ms ease-in-out;

-moz-transition: height 500ms ease-in-out;

-ms-transition: height 500ms ease-in-out;

-o-transition: height 500ms ease-in-out;

transition: height 500ms ease-in-out;

}

.owl-carousel .owl-item{

float: left;

}

.owl-controls .owl-page,

.owl-controls .owl-buttons div{

cursor: pointer;

}

.owl-controls {

-webkit-user-select: none;

-khtml-user-select: none;

-moz-user-select: none;

-ms-user-select: none;

user-select: none;

-webkit-tap-highlight-color: rgba(0, 0, 0, 0);

}


我来说两句
  • KNWJ
    KNWJ 3年前
    自己回答了
    margin:0 auto;就好了,不过是在更上层的DIV里加的
    
    .aad{
        text-align: center;
        margin:0 auto
        position: relative;
        z-index: 20;
        max-width: 1280px;
    }
    
    
    0
    回复
作者信息
发布见解
发内容 回顶部