看看这张照片并告诉我出了什么问题

时间:2016-09-29 05:24:02

标签: html css twitter-bootstrap

enter image description here

如何解决?
请看这张照片并告诉我出了什么问题。

PS:所有图像都是400 * 250,但绿色图像是399 * 250.我认为“img-responsive”类会修复它,但它不起作用。

  
<body>
<div class="container">
  <div class="row">
    <div class="col-md-4">
      <a href="" class="thumbnail">
        <img  class="img-responsive" src="img\1.jpg" alt="">
      </a>
    </div>
    <div class="col-md-4">
      <a href="" class="thumbnail">
        <img class="img-responsive" src="img\2.jpg" alt="">
      </a>
    </div>
    <div class="col-md-4">
      <a href="" class="thumbnail">
        <img class="img-responsive" src="img\3.jpg" alt="">
      </a>
    </div>
    <div class="col-md-4">
      <a href="" class="thumbnail">
        <img class="img-responsive" src="img\4.jpg" alt="">
      </a>
    </div>
    <div class="col-md-4">
      <a href="" class="thumbnail">
        <img class="img-responsive" src="img\5.jpg" alt="">
      </a>
    </div>
    <div class="col-md-4">
      <a href="" class="thumbnail">
        <img class="img-responsive" src="img\6.jpg" alt="">
      </a>
    </div>
    <div class="col-md-4">
      <a href="" class="thumbnail">
        <img class="img-responsive" src="img\7.jpg" alt="">
      </a>
    </div>
    <div class="col-md-4">
      <a href="" class="thumbnail">
        <img class="img-responsive" src="img\8.jpg" alt="">
      </a>
    </div>
    <div class="col-md-4">
      <a href="" class="thumbnail">
        <img class="img-responsive" src="img\9.jpg" alt="">
      </a>
    </div>
  </div>
</div>
</body>
</html>

1 个答案:

答案 0 :(得分:0)

试试这个,也许这会对你有所帮助,在这里我拍摄了吉他图像(400 * 250)和飞机图像(399 * 250),如你所说

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
@media only screen and (min-width : 980px) {
    .img-responsive {
       height:250px !important;
    }
}
</style>
</head>
<body>

<div class="container">
  <div class="row">
    <div class="col-md-4">
      <a href="" class="thumbnail">
        <img  class="img-responsive" src="http://2.bp.blogspot.com/-MWgiQDpUc-U/ULjocrm-69I/AAAAAAAAA5g/SOEefmhNo1A/s400/nice+guitar.jpg" alt="">
      </a>
    </div>
    <div class="col-md-4">
      <a href="" class="thumbnail">
        <img class="img-responsive"  src="http://2.bp.blogspot.com/-MWgiQDpUc-U/ULjocrm-69I/AAAAAAAAA5g/SOEefmhNo1A/s400/nice+guitar.jpg" alt="">
      </a>
    </div>
    <div class="col-md-4">
      <a href="" class="thumbnail">
        <img class="img-responsive" src="http://2.bp.blogspot.com/-MWgiQDpUc-U/ULjocrm-69I/AAAAAAAAA5g/SOEefmhNo1A/s400/nice+guitar.jpg" alt="">
      </a>
    </div>
    <div class="col-md-4">
      <a href="" class="thumbnail">
        <img class="img-responsive" src="http://2.bp.blogspot.com/-MWgiQDpUc-U/ULjocrm-69I/AAAAAAAAA5g/SOEefmhNo1A/s400/nice+guitar.jpg" alt="">
      </a>
    </div>
    <div class="col-md-4">
      <a href="" class="thumbnail">
        <img class="img-responsive" src="http://www.pilotstoresusa.com/resize/Shared/images/jcwings/JC4QBA020.jpg?lr=t&bh=250" alt="">
      </a>
    </div>
    <div class="col-md-4">
      <a href="" class="thumbnail">
        <img class="img-responsive" src="http://2.bp.blogspot.com/-MWgiQDpUc-U/ULjocrm-69I/AAAAAAAAA5g/SOEefmhNo1A/s400/nice+guitar.jpg" alt="">
      </a>
    </div>
    <div class="col-md-4">
      <a href="" class="thumbnail">
        <img class="img-responsive" src="http://2.bp.blogspot.com/-MWgiQDpUc-U/ULjocrm-69I/AAAAAAAAA5g/SOEefmhNo1A/s400/nice+guitar.jpg" alt="">
      </a>
    </div>
    <div class="col-md-4">
      <a href="" class="thumbnail">
        <img class="img-responsive" src="http://2.bp.blogspot.com/-MWgiQDpUc-U/ULjocrm-69I/AAAAAAAAA5g/SOEefmhNo1A/s400/nice+guitar.jpg" alt="">
      </a>
    </div>
    <div class="col-md-4">
      <a href="" class="thumbnail">
        <img class="img-responsive" src="http://2.bp.blogspot.com/-MWgiQDpUc-U/ULjocrm-69I/AAAAAAAAA5g/SOEefmhNo1A/s400/nice+guitar.jpg" alt="">
      </a>
    </div>
  </div>
</div>
</body>
</html>