我正試圖在2個div中實現過去和未來的圖片行。屏幕左側的所有圖像從右到左堆疊到無窮遠,屏幕堆疊右側的所有圖像從左到右無窮大。我已經幾乎達到了這一點,除非我無法阻止圖像走向新的路線。CSS堆棧圖像從右到左,出DIV
HTML
<div id="parent1">
<div id="past">
<img id="topic1" src="./img/topic1.png"></img>
<img id="topic2" src="./img/topic2.png"></img>
...
</div>
<div id="future">
<img id="topic1a" src="./img/topic1a.png"></img>
<img id="topic2b" src="./img/topic2b.png"></img>
...
</div>
</div>
CSS
#parent {
position: absolute;
height: 100%;
width: 100%;
top: 0%;
left: 0%
}
#future {
position: absolute;
height: 100%;
width:50%;
left:50%;
top:0%
}
#future img {
float: left;
height: auto;
width: auto;
margin: 1%;
max-height: 100%;
white-space: nowrap;
}
#past {
position: absolute;
height: 100%;
width:50%;
left:0%;
top:0%
}
#past img {
float: right;
height: auto;
width: auto;
margin: 1%;
max-height: 100%;
white-space: nowrap;
}
任何幫助將是巨大的。目前他們正在垂直堆疊到無限:(
這將是除了我用過NOWRAP。仍然沒有解決問題 – Hepburn3D
你可以添加一個[JSFiddle](http://jsfiddle.net)來展示你的代碼嗎?你可能會擺脫浮動圖像顯示內聯塊,所以我不認爲他們需要 –
http://jsfiddle.net/XHacq/ 有史以來第一次小提琴,那很有趣 – Hepburn3D