bootstrap轮播图像尺寸

时间:2016-03-23 10:56:02

标签: css twitter-bootstrap carousel

我有图像尺寸的probs放在旋转木马内。我加载的任何图像(具有不同的尺寸px)我得到一个图像在整个carouse宽度上拉长并且与原始图像不成比例。 我该如何修复CSS?我可以将图像放在旋转木马的中央而不会延长到左/右边界吗?这是我的CSS:

.carousel {
  height: 500px;
  margin-bottom: 10px;
}
/* Since positioning the image, we need to help out the caption */
.carousel-caption {
  z-index: 100;
}

/* Declare heights because of positioning of img element */
.carousel .item {
  height: 500px;
  background-color: #FFF;
}
.carousel-inner > .item > img {
  position: center;
  top: 0;
  left: 10;
  min-width: 100%;
  height: 500px;
}

1 个答案:

答案 0 :(得分:0)

解决方案是将css代码放入css文件

.carousel-inner > .item > img {
    margin: 0 auto;
}
相关问题