簡體   English   中英

將鼠標懸停在IE中的圖片上時,如何刪除下划線?

[英]How to remove underline when hovering over an image in IE?

在此處輸入圖片說明

我正在使用數據表,並且表中的每一行都有一列圖標。 我注意到在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;
}

您必須給border:none to image標簽

的CSS

img{
 border:none;
}
tr td a:hover{

   text-decoration: none !important;  
}

嘗試將:hover選擇器設置為包括text-decoration: none;

例:

yourelement:hover{
    text-decoration: none;
}

沒有代碼,我們真的不知道您的環境是什么樣的。

但是您可以嘗試。

.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;  
}

但是,如果您不想刪除表格單元格中所有錨點的下划線,則需要指定一個類:

tr td a.nounderline:hover{
   text-decoration: none !important;  
}

並將anchors class屬性設置為nounderline。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM