1
我在沒有使用Doctype的情況下構建了我的頁面,但是如果沒有它,我可能會得到我期待的結果。Doctype忽略了百分比
我試圖列出每行4個圖像並填充頁面,即使用戶試圖調整窗口大小。
問題是我最近添加了Doctype,而且這裏的工作不太好,圖像顯得雜亂無章。
我沒有文檔類型
我的網頁頁面文檔類型
我的jsfiddle在這裏。
http://jsfiddle.net/fk834aLa/1/
CSS:
body{
margin: 0 auto;
}
.photosquare{
height:25%;
width:25%;
float:left;
position:relative;
}
.photosquare img{
height:100%;
width:100%;
float:left;
position:relative;
}
HTML
<body>
<div class="first_page">
<div class="photosquare">
<img src="https://unsplash.imgix.net/photo-1428278953961-a8bc45e05f72?fit=crop&fm=jpg&h=700&q=75&w=1050" />
</div>
<div class="photosquare">
<img src="https://unsplash.imgix.net/photo-1428278953961-a8bc45e05f72?fit=crop&fm=jpg&h=700&q=75&w=1050" />
</div>
</div>
</body>
我在做什麼錯?
謝謝。
所有圖片高度700像素,但其中一個是725像素,當修復它的問題解決了。 http://jsfiddle.net/fk834aLa/2/ – Gaslan