我們有一個提示框,其CSS低於:工具提示框,看起來怪怪當輸入文本太長
.radioButton-tooltip
{
position: absolute;
width: 205px;
padding: 5px 20px 5px 35px;
left: 100%;
margin-left: -17px;
font-size: 13px;
background: url(images/tooltip.png) 0 center no-repeat;
color: #ffffff;
display: none;
text-align:left;
z-index:100;
}
.radioButton-tooltip:before, .radioButton-tooltip:after, .radioButton-tooltip .before, .radioButton-tooltip .after
{
content: '';
background-image: url(images/tooltip.png);
background-repeat: no-repeat;
height: 10px;
width: 100%;
display: block;
position: absolute;
left: 0;
z-index:100;
}
.radioButton-tooltip:before, .radioButton-tooltip .before
{
background-position: 0 top;
top: -10px;
z-index:100;
}
.radioButton-tooltip:after, .radioButton-tooltip .after
{
background-position: 0 bottom;
bottom: -10px;
z-index:100;
}
通常情況下,它工作正常。如圖所示:
然而,當文本變得很長,它看起來如下:
我不太清楚這是怎麼引起的,但我假設它是因爲文本太長,超出了原始tooltip.png的最大長度。但問題是我該如何解決這個問題?
謝謝。
添加一個工作演示,瞭解HTML結構 – aje
你可以包括你的HTML以及 –
添加'溢出-Y:滾動;'如果你不想要的佈局被打破。這可能是你使用的絕對位置,它在'px'中。 – user3771102