我在這裏讀了很多關於組合不同溢出值的問題。但是,我找不到解決我的問題的方法,這是以下內容。組合溢出-y:auto和overflow-x:可見
我有一個圖像,它比它的容器大。所以,我想讓它在x方向上可見,並在y方向上滾動(或自動)。
一個可能的解決方案是增加#inner的寬度並使其等於圖像寬度,但我不允許這樣做。我試圖插入一個包裝(#outter),但它沒有工作。
有沒有人想要如何解決這個問題?
#outter {
width: 200px;
height: 200px;
overflow-y: scroll;
}
#inner {
overflow-x: visible;
width: 200px;
height: 200px;
}
img {
width: 400px;
height: 400px
}
<div id="outter">
<div id="inner">
<img src="http://www.w3schools.com/images/w3schools_green.jpg" alt="W3Schools.com">
</div>
</div>
非常感謝你! – themis93