0
我剛開始學習編碼,並決定使用squarespace
和www.rociodelfa.com
來設計我的網站。避免圖像在手機上堆疊
我的主要問題是,在我的靈感頁面我有一個需要遵循連貫順序的圖像庫,並且我想修復每行圖像的數量,但對於每一行都不相同。
在移動設備上打開時,圖像被堆疊。我該如何改變它?
我剛開始學習編碼,並決定使用squarespace
和www.rociodelfa.com
來設計我的網站。避免圖像在手機上堆疊
我的主要問題是,在我的靈感頁面我有一個需要遵循連貫順序的圖像庫,並且我想修復每行圖像的數量,但對於每一行都不相同。
在移動設備上打開時,圖像被堆疊。我該如何改變它?
檢查我附加的代碼。
* {
box-sizing: border-box;
}
.wrapper {
width: 20%; /* Let's assume you want 5 pictures in a row, so 100%/5 = 20% */
float: left;
padding: 10px;
}
.wrapper img {
width: 100%;
}
<div class="wrapper">
<img src="http://placehold.it/300x300">
</div>
<div class="wrapper">
<img src="http://placehold.it/300x300">
</div>
<div class="wrapper">
<img src="http://placehold.it/300x300">
</div>
<div class="wrapper">
<img src="http://placehold.it/300x300">
</div>
<div class="wrapper">
<img src="http://placehold.it/300x300">
</div>
<div class="wrapper">
<img src="http://placehold.it/300x300">
</div>
<div class="wrapper">
<img src="http://placehold.it/300x300">
</div>
<div class="wrapper">
<img src="http://placehold.it/300x300">
</div>
<div class="wrapper">
<img src="http://placehold.it/300x300">
</div>
<div class="wrapper">
<img src="http://placehold.it/300x300">
</div>
當你有移動第一網站,圖像時屏幕的寬度減小疊加。如果你可以添加一個codepen或小提琴,那麼我們可能會幫助你。 – Aslam