0

我有一个元素,它有一个overflow-x:hiddenoverflow-y: visible并且在它里面有一个绝对位置的元素,我希望在它上面溢出。我认为如果我给父元素一个overflow-y: hidden那么它会起作用,但是浏览器只是添加一个滚动条而不是让子元素溢出父元素。

这是一个演示我的情况的小提琴:

<!DOCTYPE html>
<html>
<head>
<style> 
div
{
width:110px;
height:110px;
border:thin solid black;
overflow-x:hidden;
overflow-y: visible;
position: relative;
}
</style>
</head>
<body>

<div><p style="position: absolute;">
In my younger and more vulnerable years my father gave me some advice that I've been turning over in my mind ever since.
'Whenever you feel like criticizing anyone,' he told me, 'just remember that all the people in this world haven't had the advantages that you've had.' 
</p></div>

<p>Overflow-x specifies whether or not to clip the left/right edges of the content.</p>
<p>Overflow-y specifies whether or not to clip the top/bottom edges of the content.</p>

</body>
</html>

http://jsfiddle.net/QNDJj/

4

0 回答 0