Twitter Bootstrap: Have carousel images full width and height

前端 未结 6 1320
日久生厌
日久生厌 2020-12-30 01:31

this seems as a trivial question but after a couple of hours fiddling with the Twitter Bootstrap carousel in their example (http://twitter.github.io/bootstrap/examples/carou

6条回答
  •  攒了一身酷
    2020-12-30 02:17

    Think I have got a solution with simple CSS changes? Just change the following from (OLD) to;

        .carousel {
      /*height: 500px; OLD*/
      /*margin-bottom: 60px; OLD*/
    
      /*max-width:1200px; THIS IS OPTIONAL (ANY SIZE YOU LIKE)*/
      margin:0 auto 60px;
    }
    
    .carousel .item {
        /*height: 500px; OLD*/
        /*background-color: #777; OLD*/
    
        width:100%;
        height:auto;
    }
    .carousel-inner > .item > img {
      /*position: absolute; OLD+WHY?*/
      /*top: 0; OLD+WHY?*/
      /*left: 0; OLD+WHY?*/
    
      min-width:100%;
      height:auto;
    }
    

提交回复
热议问题