如何制作尺寸为80 * 60的旋转木马?

时间:2014-09-04 06:16:29

标签: css twitter-bootstrap

我有一个旋转木马,我希望我的旋转木马尺寸变成80 * 60。我能做到吗?

<div id="mycarousel2" class="carousel slide" data-ride="carousel">
    <div class="carousel-inner">
        <div class="item active">
            <img src="IMG1.png" alt="..." class="img-responsive">
        </div>
        <div class="item">
            <img src="IMG2.png" alt="..." class="img-responsive">
        </div>
        <div class="item">
            <img src="IMG3.png" alt="..." class="img-responsive">
        </div>
    </div>
</div>

2 个答案:

答案 0 :(得分:0)

您可以将其包装在一个小块80 x 60

Bootply http://www.bootply.com/bHdeZhS30z

<强> HTML

<div class="small-block">
  <div id="mycarousel2" class="carousel slide" data-ride="carousel">
      <div class="carousel-inner">
          <div class="item active">
              <img src="IMG1.png" alt="..." class="img-responsive">
          </div>
          <div class="item">
              <img src="IMG2.png" alt="..." class="img-responsive">
          </div>
          <div class="item">
              <img src="IMG3.png" alt="..." class="img-responsive">
          </div>
      </div>
  </div>
</div>

<强> CSS

.small-block{
    width:80px;
    height:60px;
    background: cyan;
  }

答案 1 :(得分:0)

<强> CSS

.carousel-inner{
  width:80px;
  height:60px;
  overflow:hidden;
}
.carousel-inner img{
  width:80px;
  height:auto;
}