Make bootstrap carousel responsive on height

后端 未结 7 1677
夕颜
夕颜 2021-02-05 14:51

I need to customize BS carousel, to make images size responsive corectly. I need the carousel to adapt to the height of the active slides images initiel height. When the viewpor

7条回答
  •  情深已故
    2021-02-05 15:44

    define for every devices such as

    @media (min-width: 360px) {
      .carousel {
        min-height: 140px;
       margin-bottom: 60px;
      }
      /* Since positioning the image, we need to help out the caption */
      .carousel-caption {
        z-index: 10;
        }
    
       /* Declare heights because of positioning of img element */
       .carousel .item {
        min-height: 140px;
        background-color: #777;
        }
       .carousel-inner > .item > img {
        position: absolute;
       top: 0;
       left: 0;
       min-width: 100%;
       min-height: 140px;
      }
    
    
    }
    

提交回复
热议问题