Css 引导转盘图像尺寸

Css 引导转盘图像尺寸,css,twitter-bootstrap,carousel,Css,Twitter Bootstrap,Carousel,我有问题,在尺寸的图像要放在旋转木马。我加载的任何图像(具有不同的尺寸px)都会在整个旋转木马宽度上拉长,并且与原始图像不成比例。。 我应该如何修复CSS?我是否可以将图像放置在旋转木马的中心,而不将其延伸到左/右边界?这是我的CSS: .carousel { height: 500px; margin-bottom: 10px; } /* Since positioning the image, we need to help out the caption */ .carousel-

我有问题,在尺寸的图像要放在旋转木马。我加载的任何图像(具有不同的尺寸px)都会在整个旋转木马宽度上拉长,并且与原始图像不成比例。。 我应该如何修复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;
}

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

.carousel-inner > .item > img {
    margin: 0 auto;
}

我在我的页面和“项目”部分使用了旋转木马:
用于将项目div定位在中心,并控制宽度和所有工作。此问题可能有助于: