bootstrap的栅格使用问题

 <div class="row">
            <div class="col-xs-6 col-md-3 col-lg-2"><a href="photo1.html"><img class="photo_list" src="images/1.jpg" alt="my wallpaper1"></a></div>
            <div class="col-xs-6 col-md-3 col-lg-2"><a href="photo1.html"><img class="photo_list" src="images/3.jpeg" alt="my wallpaper1"></a></div>
            <div class="col-xs-6 col-md-3 col-lg-2"><a href="photo1.html"><img class="photo_list" src="images/2.jpeg" alt="my wallpaper1"></a></div>
            <div class="col-xs-6 col-md-3 col-lg-2"><a href="photo1.html"><img class="photo_list" src="images/4.jpeg" alt="my wallpaper1"></a></div>  
            <div class="col-xs-6 col-md-3 col-lg-2"><a href="photo1.html"><img class="photo_list" src="images/1.jpg" alt="my wallpaper1"></a></div>
            <div class="col-xs-6 col-md-3 col-lg-2"><a href="photo1.html"><img class="photo_list" src="images/3.jpeg" alt="my wallpaper1"></a></div>
            <div class="col-xs-6 col-md-3 col-lg-2"><a href="photo1.html"><img class="photo_list" src="images/2.jpeg" alt="my wallpaper1"></a></div>
            <div class="col-xs-6 col-md-3 col-lg-2"><a href="photo1.html"><img class="photo_list" src="images/4.jpeg" alt="my wallpaper1"></a></div>  
            <div class="col-xs-6 col-md-3 col-lg-2"><a href="photo1.html"><img class="photo_list" src="images/1.jpg" alt="my wallpaper1"></a></div>
            <div class="col-xs-6 col-md-3 col-lg-2"><a href="photo1.html"><img class="photo_list" src="images/3.jpeg" alt="my wallpaper1"></a></div>
            <div class="col-xs-6 col-md-3 col-lg-2"><a href="photo1.html"><img class="photo_list" src="images/2.jpeg" alt="my wallpaper1"></a></div>
            <div class="col-xs-6 col-md-3 col-lg-2"><a href="photo1.html"><img class="photo_list" src="images/4.jpeg" alt="my wallpaper1"></a></div>  
            <div class="col-xs-6 col-md-3 col-lg-2"><a href="photo1.html"><img class="photo_list" src="images/1.jpg" alt="my wallpaper1"></a></div>
            <div class="col-xs-6 col-md-3 col-lg-2"><a href="photo1.html"><img class="photo_list" src="images/3.jpeg" alt="my wallpaper1"></a></div>
            <div class="col-xs-6 col-md-3 col-lg-2"><a href="photo1.html"><img class="photo_list" src="images/2.jpeg" alt="my wallpaper1"></a></div>
            <div class="col-xs-6 col-md-3 col-lg-2"><a href="photo1.html"><img class="photo_list" src="images/4.jpeg" alt="my wallpaper1"></a></div>  
</div>

结果:
图片描述

为什么会出现空白?

.photo_list{
    width:100%;
    max-height: 200px;
    padding: 10px;
}
阅读 2.5k
2 个回答

大概是图片有了最大的高度,所以被按比例缩放了了。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏