[英]div with image gallery will not align center
我有一個投資組合,我在很多人和教程的幫助下建立了自己。 我注意到實際的畫廊(目前有8個大拇指)不會居中。 特別是當縮放到移動尺寸時,它看起來有點彎曲。
我把畫廊包裹在一個名為'imagewrapper'的div中並賦予它們這些屬性;
.imagewrapper{
width: 80%;
margin: 0 auto;
height:100%;
}
寬度是否與我的div的對齊混亂? 完整的代碼在這里; http://kellyvuijst.nl 。 如果你能把我送上正確的方向,那將會很棒。
我只想對你的CSS進行一些修改:
.imagewrapper{
width: 80%;
margin: 0 auto;
height:100%;
text-align: center; /* add this */
}
.mask {
position:relative;
height:180px;
width:240px;
box-shadow:0 0 1px #000;
border:5px solid #f6f6f6;
overflow:hidden;
float:left; /* delete this */
margin:15px;
display: inline-block; /* add this */
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.