简体   繁体   English

如何使Bootstrap缩略图图像具有相同的高度,以使缩略图面板对齐?

[英]How can I make Bootstrap thumbnail images the same height so that the thumbnail panels align?

I'm using Bootstrap thumbnails with SVG that I got from Wikipedia but for some reason the SVG are all different sizes so it causes the thumbnail panels to not align. 我将Bootstrap缩略图与从Wikipedia获得的SVG结合使用,但由于某些原因,SVG的尺寸均不同,因此导致缩略图面板无法对齐。

Using what method can I make the thumbnail images the same height so that the thumbnail panels align? 我可以使用哪种方法使缩略图图像具有相同的高度,以使缩略图面板对齐?

Code: 码:

<div class="row">
  <div class="col-md-3">
    <div class="thumbnail">
      <img src="Flag_of_England.svg" style="width: 100%;" alt="England Chat">
      <div class="caption">
        <h3>England Chat</h3>
        <p>...</p>
        <p><a href="/chat" class="btn btn-primary" role="button">Chat</a></p>
      </div>
    </div>
  </div>
  <div class="col-md-3">
    <div class="thumbnail">
      <img src="Flag_of_Ireland.svg" style="width: 100%;" alt="Ireland Chat">
      <div class="caption">
        <h3>Ireland Chat</h3>
        <p>...</p>
        <p><a href="/chat" class="btn btn-primary" role="button">Chat</a></p>
      </div>
    </div>
  </div>
  <div class="col-md-3">
    <div class="thumbnail">
      <img src="Flag_of_Scotland.svg" style="width: 100%;" alt="Scotland Chat">
      <div class="caption">
        <h3>Scotland Chat</h3>
        <p>...</p>
        <p><a href="/chat" class="btn btn-primary" role="button">Chat</a></p>
      </div>
    </div>
  </div>
  <div class="col-md-3">
    <div class="thumbnail">
      <img src="Flag_of_Wales.svg" style="width: 100%;" alt="Wales Chat">
      <div class="caption">
        <h3>Wales Chat</h3>
        <p>...</p>
        <p><a href="/chat" class="btn btn-primary" role="button">Chat</a></p>
      </div>
    </div>
  </div>
</div>

Screenshot: 屏幕截图:

在此处输入图片说明

It looks more like you'd need to adjust the height of images to align them, but it would have to be a fixed number which probably isn't ideal. 它看起来更像是您需要调整图像的高度以使其对齐,但是它必须是一个固定的数字,可能并不理想。 You could made 2 rows, one for images and one for text, and as long as each row contained 4 rows with class="col-md-3" the content would all align vertically, but not sure there's another way around it 您可以制作2行,其中一行用于图像,一行用于文本,只要每行包含4行并带有class =“ col-md-3”的行,内容将全部垂直对齐,但是不确定是否有另一种方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM