任何想法爲什麼我無法更改縮略圖照片的大小?我希望他們全部是相同的:在畫廊中將所有縮略圖製作成相同大小
<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 這是我所看到的:
我使用這個:http://codepen.io/dimsemenov/pen/ZYbPJM
更新: 我改變了CSS然而,保證金的權利不會受到影響,如果我將它們設爲200x200,則不會有保證金。這是爲什麼?
.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;
}
嘗試設置'從CSS像這樣'IMG {高度img'屬性的高度和寬度:10px的;寬度:10px; }'看看這是否可行 – Smit
你是什麼意思的大小?你想要高度相等? –
我希望它們都是200x200的正方形 –