0
如何爲絕對定位元素設置overflow:hidden屬性。我知道設置絕對位置使元素不在文件流中。這是我的代碼。我一直在試圖設置溢出:對於img元素隱藏了這麼久。請幫幫我。絕對定位元素的overflow屬性
HTML
<html>
<head>
<link rel="stylesheet" type="text/css" href="Style.css">
</head>
<body>
<div>
<img src="http://photoblogstop.com/wp-content/uploads/2012/07/Sierra_HDR_Panorama_DFX8048_2280x819_Q40_wm_mini.jpg"/>
</div>
</body>
</html>
CSS
body {
margin: 0;
}
div {
width: 100%;
overflow: hidden;
}
img {
position: absolute;
height: 100%;
clip: rect(0px, 678px, 600px, 0px)
}
可能是這有助於http://stackoverflow.com/questions/12463658/parent-child-with-position-fixed-parent-overflowhidden-bug –
好,謝謝。我不知道,我現在不知道。:-) – microman
不要說那樣的話,檢查那個鏈接,如果它不是你的問題,分享你的感受,這是問題的答案千差萬別的地方,沒有SOI的FYI程序員不會走得這麼遠。 –