나는 다음과 같은 도구 설명이 있습니다표시 요소
#left_div {
max-height:170px;
overflow-x:hidden;
overflow-y:scroll;
}
a.tditems_tooltip {
position: relative;
display: inline-block;
text-decoration:none;
}
a.tditems_tooltip span {
position: absolute;
max-width:400px;
color:#FFFFFF;
line-height:16px;
padding:0;
background:url('/layouts/background.gif');
border: 1px solid #CFB57C;
text-align: center;
display: none;
text-decoration:none;
font-size: 12px;
box-shadow: 0 1px 4px #AAAAAA;
}
a.tditems_tooltip span:after {
content: '';
position: absolute;
top: 100%;
left: 0%;
margin-left: 150px;
max-width:800px;
text-decoration:none;
}
a:hover.tditems_tooltip span {
display: inline-block;
bottom: 100%;
left: 0%;
margin-left: -3px;
z-index: 1000;
text-decoration:none;
}
<table border="0" cellspacing="1" cellpadding="1" width="400" height="300">
<tr>
<td width="50%">
<div id="left_div">
</br>
</br>
</br>
</br>
<a class="tditems_tooltip">
<font color="red">TRIGGER</font>
<span>
<table border="0" cellspacing="0" cellpadding="1" width="300">
<tr bgcolor="green">
<td>CONTENT OF TOOLTIP</td>
</tr>
</table>
</span>
</a>
</br>
</br>
</br>
</br>
</br>
</br>
</br>
</br>
</div>
</td>
<td width="50%">INSIGNIFICANT CONTENT</td>
</tr>
</table>
그리고 지금까지 그것은 내가 의도와 무엇을 거의 완벽하게 작동한다. .. 한 가지를 제외하고는 : 툴팁 (span
)은 페이지의 다른 모든 요소의 맨 위에 표시되지 않고 그 뒤에 표시됩니다. 위의 스 니펫을 확인하십시오.
참고 : 나는 CSS
overflow-x
과td
에서overflow-y
에서 제거 할 때가 의도하는 방법을 보여줍니다,하지만 난 아직도 그td
에max-height
를 지정해야합니다 ...
아이디어가 있으십니까?
당신이해야 할 일입니다 (BTW, 내가 추가 한 스타일
a.tditems_tooltip span > table
미만),하지만 당신은 여전히 최대 높이를 지정해야 의미합니까? 당신이 지금 가지고있는 최대 높이와 높이는 그 값이 무효이기 때문에 무시되고 있기 때문에, 그 중 아무 것도 필요하지 않습니다. –@MichaelCoker 죄송합니다. 지금 스 니펫을 실행할 수 있습니까? –
변경된 것을 볼 수 있지만 동작은 여전히 동일하게 보입니다. 요소에서'오버플로 (overflow) '를 제거하면 요소가 수정됩니다. 'max-height'의 동작은'overflow'가 정의되어 있는지 여부에 상관없이 같습니다. 오버플로를 제거하는 것이 잘못된 이유는 무엇입니까? –