我有一個全球性的javascript函數.appends()
工具提示元素與data-tooltip
屬性的任何元素。錨的小孩不能刪除文字裝飾?
這是所有酷,直到我試圖給一個a
nchor的data-tooltip
屬性,這似乎打破了CSS,因爲我似乎無法刪除的工具提示text-decoration
規則。
我該如何刪除text-decoration
對錨的孩子?
下劃線顯然是從父定位點繼承的,因爲它具有默認錨點顏色下劃線,但工具提示文本的color
爲橙色。
請參閱http://img.ly/35kc瞭解我所談論的內容。
更新
這裏是我的工具提示CSS,按要求
/*TOOLTIPS*/
.tooltip_placeholder {
position: relative;
width: 0px;
height: 0px;
white-space:nowrap;
display: inline;
z-index: 100;
text-decoration: none;
}
.tooltip_boundary {
position: absolute;
width: 300px;
z-index: 100;
text-decoration: none;
}
.tooltip_border {
z-index: 100;
background: url(/sales/global/images/tooltip_arrow.png) no-repeat;
padding-left: 35px; /*left offset*/
background-position: 16px 0px;
float: left;
z-index: 100;
text-decoration: none;
}
.tooltip {
padding: 8px;
color: #A97D35;
background: #FBF98E;
-moz-border-radius: 0px 8px 8px 8px;
border-radius: 0px 8px 8px 8px;
border: 6px solid #F9E98E;
font-size: 12px;
text-transform: none;
z-index: 100;
text-decoration: none;
}
這是一個提示是如何投入:
$(element).append('<div class="tooltip_placeholder"><div class="tooltip_boundary"><div class="tooltip_border" style="display: none;"><div class="tooltip">'+$(element).attr('data-tooltip')+'</div></div></div></div>')
更新2
@Guffa善意地撥弄了這個http://jsfiddle.net/TxRmk/ 這個問題似乎是瀏覽器特定的,因爲我可以讓它在FF中工作,而不是Safari或Chrome。沒有檢查IE,但它可能做了完全不同的事情
你可以發佈你的CSS?在黑暗中拍攝,否則...... – TNC 2011-02-24 22:09:32
'a.iHasAToolTip .toolTipElement {text-decoration:none}'? – thirtydot 2011-02-24 22:10:59
發佈您的HTML/CSS。這聽起來像是CSS特性的問題。像我之前評論中的選擇器可能已經足夠好了。 – thirtydot 2011-02-24 22:13:33