절대 div에 음수 위치 (예 : 상단 -20px)를 사용하고 부모 div에 오버플로 자동을 추가 할 때 문제가 있습니다. 텍스트는 으로 모든 브라우저에 숨겨져 있습니다. 나는 그것을 보이게하고 싶다. 내 응용 프로그램 구조에서 제거 할 수 없습니다 overflow:auto;
. 어떤 생각이 들었는지, 어떻게 보이게 할 수 있습니까? 이 코드를 복사하면 더 좋은 아이디어를 얻을 수 있습니다.오버플로 자동 네거티브 위치 요소 숨김
<!DOCTYPE html>
<head>
<title>Untitled Document</title>
<style>
body{
margin:50px;
}
.Relative{
width:200px;
height:200px;
position:relative;
overflow:auto;
background-color:#CCCCCC;
z-index:1;
}
.Abs{
position:absolute;
top:-20px;
right:0;
width:100px;
height:100px;
border:solid 1px;
background-color:#99CCCC;
z-index:99999999 !important;
}
.RemoveOverFlow{
overflow:inherit;
}
</style>
</head>
<body>
<div class="Relative RemoveOverFlow">
<div class="Abs">This is a test text in absolute div</div>
Remove <br />
overflow <br />
from the <br />
relative div
</div>
<br />
<br />
<div class="Relative">
<div class="Abs">This is a test text in absolute div</div>
Add <br />
overflow:auto <br />
into <br />
relative div
</div>
</body>
</html>
감사합니다 ..하지만 불가능한 overflow : auto를 제거하십시오. 그것을 제거하지 않고 우리가 할 수 있습니까? – Avkash
overflow : visible이있는 .Relative 클래스에 대해 나중에 다른 규칙을 정의하면 첫 번째 규칙보다 우선 적용됩니다. – fcalderan