gpt4 book ai didi

html - 使画廊中的所有缩略图大小相同

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

知道为什么我不能更改缩略图的大小吗?我希望它们都一样:

 <h2>Book:</h2>

<div class="my-gallery" itemscope itemtype="http://schema.org/ImageGallery">

<figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
<a href="imgur/book/2EuGD9S.jpg" itemprop="contentUrl" data-size="900x900">
<img src="imgur/book/2EuGD9S.jpg" itemprop="thumbnail" alt="Image description" height="300" width="300" />
</a>
<figcaption itemprop="caption description">Image caption 1</figcaption>

</figure>

<figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
<a href="imgur/book/Cmg3qMt.jpg" itemprop="contentUrl" data-size="900x900">
<img src="imgur/book/Cmg3qMt.jpg" itemprop="thumbnail" alt="Image description" data-size="300x300" />
</a>
<figcaption itemprop="caption description">Image caption 2</figcaption>
</figure>

<figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
<a href="imgur/book/DyvInMR.jpg" itemprop="contentUrl" data-size="900x900">
<img src="imgur/book/DyvInMR.jpg" itemprop="thumbnail" alt="Image description" data-size="300x300" />
</a>
<figcaption itemprop="caption description">Image caption 3</figcaption>
</figure>



</div>

完整代码:https://gist.github.com/monajalal/3dace3489e20e0aeeba5351a7987065a这是我看到的: enter image description here

我正在使用这个:http://codepen.io/dimsemenov/pen/ZYbPJM

更新:我更改了 CSS,但 margin-right 不会受到影响,如果我将它们设为 200x200,则不会有边距。这是为什么? enter image description here

.my-gallery {
width: 100%;
float: left;
}
/*
.my-gallery img {
width: 100%;
height: auto;
}
*/

.my-gallery img {
height: 150px;
width: 150px;
margin-right: 10px;
}
.my-gallery figure {
display: block;
float: left;
margin: 0 5px 5px 0;
width: 150px;
}
.my-gallery figcaption {
display: none;
}

最佳答案

不是为图形分配宽度/高度,而是将其分配给图像。

.my-gallery img {
width: 200px;
height: 200px;
display: block;
}
.my-gallery figure {
display: block;
float: left;
margin: 0 5px 5px 0;
}

产生这样的显示: enter image description here

关于html - 使画廊中的所有缩略图大小相同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40669041/

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