這是我的要求。 我有三個圖像應該並排排列。當我減少剩餘邊距時,所有三張圖像都應該逐個隱藏在隊列中。將三個圖像並排排列在一個div中,一次顯示一個圖像並隱藏兩個圖像
這裏來了我的實際問題。當我增加剩餘邊距時,所有圖像都應該到隊列中的右側隱藏部分。但對我而言,他們正在走下坡路。
我的HTML,
<div class="content">
<div class="images">
<img id="left-img" src="img/trees.png">
<img id="center-img" src="img/buildings.png">
<img id="right-img" src="img/interior.png">
</div>
</div>
我的CSS,
.content
{
width : 100%;
overflow : hidden;
}
.images
{
width : 80%;
margin-left : auto;
margin-right : auto;
height : 550px;
overflow : hidden;
}
.images-slider img
{
width: 60%;
display : inline-block;
float : left;
}
,然後當我降低利潤率左到最左側的圖像,所有的圖像應該是這樣的排列。
同樣,當我提高保證金離開了,所有的圖像應該向右走這樣的(這是不會發生)。
相反所有的圖像都下降到div當我離開增加保證金。我用position : inline;
,position : inline-block;
,float: left;
。但是沒有任何東西能爲我工作。我在哪裏錯了?請幫幫我。
'位置'不接受'inline'或'inline-block'的值 - 'display' does ... Us e'white-space:pre'在容器元素上,以便圖像不會分成幾行,但保持彼此相鄰。 – CBroe 2015-01-26 19:57:38