我正在使用數據表,表中的每一行都有一列圖標。我注意到,在Chrome和Firefox中,當我將鼠標懸停在圖標上時,它會改變顏色(這很好)。但是,在IE中,當用戶將鼠標懸停在圖標上時,圖標帶下劃線,直到用戶移動光標。我曾嘗試過:
tr td a i:hover{
text-decoration: none !important;
}
但這並不適用於我。我還將這些圖標包裝在display-inline
中,但它仍不起作用。 請幫助
我正在使用數據表,表中的每一行都有一列圖標。我注意到,在Chrome和Firefox中,當我將鼠標懸停在圖標上時,它會改變顏色(這很好)。但是,在IE中,當用戶將鼠標懸停在圖標上時,圖標帶下劃線,直到用戶移動光標。我曾嘗試過:
tr td a i:hover{
text-decoration: none !important;
}
但這並不適用於我。我還將這些圖標包裝在display-inline
中,但它仍不起作用。 請幫助
指定錨標記類:
<a class='NoUnderline'>blah blah</a>
然後起飛錨標記級別的文本的裝飾。 CSS:
a.NoUnderline
{
text-decoration:none;
}
嘗試設置:hover
選擇包括text-decoration: none;
例如:
yourelement:hover{
text-decoration: none;
}
我試過了,它沒有工作 – Muraad
歡迎來到堆棧溢出isaac。我正在審覈您的答案,並希望提供一些關於如何改進的提示。首先,當你寫一個答案時,讓你向OP解釋它是如何回答他們的問題的。其次,儘可能嘗試鏈接官方文檔來證明你的概念。最後,請閱讀以下文章:http://stackoverflow.com/help/how-to-answer –
你必須給border:none
到圖像標籤
CSS
img{
border:none;
}
tr td a:hover{
text-decoration: none !important;
}
我們真的不知道你的環境是什麼樣的,沒有代碼。
但你可以試試。
.element:hover {text-decoration: none; border: 0px}
或
img:hover {text-decoration: none; border: 0px}
如果它不能正常工作;嘗試使用!important
或文檔的<head></head>
添加它。 (但是如果你編碼正確,你不應該做這種練習)
問題是圖像本身沒有下劃線,但圍繞圖像的錨標記確實。
要從錨刪除所有下劃線,你必須這樣做:
tr td a:hover{
text-decoration: none !important;
}
但是,如果你不想從一個表格單元格中所有錨刪除下劃線,你需要一個specifiy類別:
tr td a.nounderline:hover{
text-decoration: none !important;
}
並將anchors class屬性設置爲nounderline。
我假設圖像包裹在錨標籤中?你用過「文字裝飾:沒有!重要」;在錨而不是圖像?你能告訴我們你的html/css嗎? –
你可能也有一個懸停邊框的東西,刪除邊框; 0; – Medda86
你能幫助我們創建一個小提琴嗎? https://開頭的jsfiddle。net/ – nextstep