2015-06-25 211 views
-4

將鼠標懸停在圖標圖像上時,背景顏色變爲黑色。我如何將它改爲灰色?如何將背景顏色更改爲灰色

<h2>Contact Us Anytime!</h2> 

     </div> 
    </div> </div></section> 
<section class="container"><div class="row"> 
    <div class="spb_content_element col-sm-6 column_container"> 
     <div class="spb-asset-content"> 
     <section class="container"><div class="row"> 
    <div class="spb_icon_box col-sm-12"> 
     <div class="spb-asset-content"> 
     <div class="sf-icon-box sf-icon-box-left-icon sf-animation sf-icon- " data-animation="none" data-delay="0" style="background-color:;"><div class="sf-icon-cont cont-small sf-icon-float-none"><i class="fa-map-marker sf-icon sf-icon-small" style="color:;"></i></div><div class="sf-icon-box-content-wrap clearfix"><h3 style="color:;"></h3><div class="sf-icon-box-content" style="color:;"> 
<p> CT</p> 
</div></div></div> 
     </div> 
    </div> </div></section> 
+1

你在說什麼「圖標圖像」?可能有某種形式的css規則在懸停在「不論什麼」時被應用。您可以嘗試找出自己:打開瀏覽器開發控制檯(通常爲F12)並選擇「元素」選項卡(或類似選項)。在那裏您可以看到應用於特定元素的樣式規則。您也可以切換到使用鼠標懸停時應用的規則。有什麼不同?這是你的答案! – arkascha

+0

發佈你到目前爲止嘗試過的東西。 – Cheloide

+0

在你的css中檢查類.sf-hover ...這個類將有背景顏色黑變爲灰色 – Butterfly

回答

3

變化:

.sf-hover .sf-icon-cont, .sf-hover .sf-icon-box-hr { 
    background-color: #222!important; 
} 

要:

.sf-hover .sf-icon-cont, .sf-hover .sf-icon-box-hr { 
    background-color: #8C8C8C!important; 
} 

如何審議CSS像親

1)右側的HTML元素上點擊 - >檢查元件

2)具體的DOM右鍵 - >力元狀態 - >:懸停

enter image description here

3)*與實時右側面板上的CSS播放,直到你滿意爲止。

當生活變得複雜

有時候一個複雜的程序員決定改變使用Javascript運行中的CSS。所以第二步不會有幫助。爲了解決這個問題,你可以懸停所需的元素,並見證DOM正在改變。我看到DOM正在滿足sf-hover類,所以我手動添加了這個類。這就是我能夠在右側玩CSS的原因。

enter image description here