【问题标题】:Bootstrap carousel - space on bottom with wide imagesBootstrap 轮播 - 底部空间与宽图像
【发布时间】:2015-10-06 22:03:32
【问题描述】:

图片是800*450,问题出在图片中。 (例如)320 × 455 图像不会出现问题

这是旋转木马的玉码

.col-md-12.col-xs-12
    #header-carousel.carousel.slide(data-ride="carousel", data-interval="5000")
        .carousel-inner
            each image, i in content.images
                if i === 0
                    .item.active
                    img(src="#{image}", alt="phone")
                else
                    .item
                    img(src="#{image}", alt="phone")
        a.left.carousel-control(href="#header-carousel", data-slide="prev")
            span.icon-prev
        a.right.carousel-control(href="#header-carousel", data-slide="next")
            span.icon-next

这里是自定义 CSS

.carousel-inner > .item > img,
  .carousel-inner > .item > a > img {
    width: 100%;
    margin: 0 auto;
    padding: 0px !important;
}
 .carousel-control .glyphicon-chevron-left, .carousel-control     .glyphicon-chevron-right, .carousel-control .icon-prev, .carousel-control .icon-next {
  width: 100px;
  padding: 0px !important;
  margin: 0px !important;
}

如何去除灰色部分?

【问题讨论】:

  • 你能提供一个重现问题的jsfiddle吗?
  • 为部署在某处的实时代码提供小提琴或链接

标签: css twitter-bootstrap-3 carousel


【解决方案1】:

我遇到了这个问题,尝试在图像标签中添加图像的宽度和高度属性。 像这样的:

 img(src="#{image}", alt="phone", width="800", height="450")

【讨论】:

    猜你喜欢
    • 2014-05-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多