gpt4 book ai didi

html - div 中的网格列

转载 作者:太空宇宙 更新时间:2023-11-04 15:17:46 25 4
gpt4 key购买 nike

我在我的网站上创建了一个网格,它看起来像这样。我不知道为什么,但是当 Angular 色变得太长时,div 的位置就会被破坏。谁能帮我解决这个问题并解释原因?

图片:

enter image description here

我的CSS

   .product-wrapper{
margin: 0 auto;
display: table;
text-align: center;
}
.product-holder{
display: inline-block;
width:220px;
height: 150px;
border:1px solid #666666;
margin-right: 10px;
margin-bottom: 10px;
border-radius: 5px;
-moz-box-shadow: 0 0 0 5px #666666;
-webkit-box-shadow: 0 0 0 5px #666666;
box-shadow: 0 0 5px #666666;
}

.product-image{
display: block;
width: auto;
height: 90px;
margin:10px;
border:1px solid #666666;
}
.product-caption{
width: auto;
display: block;
font-weight: bold;
margin:0 10px;
word-wrap:break-word;
}

我的html

  <div class="product-wrapper">
<div class="product-holder">
<span class="product-image"></span>
<span class="product-caption">Simple Product Name</span>
</div>
<div class="product-holder">
<span class="product-image"></span>
<span class="product-caption">AveryVeryverylongPRoductNamewithoutspace</span>
</div>
<div class="product-holder">
<span class="product-image"></span>
<span class="product-caption">AveryVeryverylongPRoductNamewithoutspace</span>
</div>
<div class="product-holder">
<span class="product-image"></span>
<span class="product-caption">Products</span>
</div>
<div class="product-holder">
<span class="product-image"></span>
<span class="product-caption">A productNamefor Sample</span>
</div>
<div class="product-holder">
<span class="product-image"></span>
<span class="product-caption">Another Product</span>
</div>
</div>

最佳答案

将此添加到 .product-holder

.product-holder { vertical-align: middle; }

关于html - div 中的网格列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14846931/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com