我需要更改懸停源URL。更改IMG圖片懸停與CSS
我都試過,但將無法工作:
這是我的CSS:
.nav > li > div {
position: absolute;
display: block;
width: 100%;
top: 38px;
left: 0;
opacity: 0;
visibility: hidden;
overflow: hidden;
background: #ffffff;
border-top-color: #5f7ec7;
border-top-style: solid;
border-top-width: 1px;
border-bottom-color: #5f7ec7;
border-bottom-style: solid;
border-bottom-width: 1px;
-webkit-transition: all .3s ease .15s;
-moz-transition: all .3s ease .15s;
-o-transition: all .3s ease .15s;
-ms-transition: all .3s ease .15s;
transition: all .3s ease .15s;
}
.nav > li:hover > div {
opacity: 1;
visibility: visible;
overflow: visible;
}
,這是我的html:
<ul class="nav" style="width: 100%">
<li>
Something
<a title="D" itemprop="url" href="/Default.aspx"><span itemprop="name">Something</span><img src="/images/Top-Menu-Layer/arrow_122b87.gif" style="vertical-align:middle; padding-left:5px; height:4px; width:7px" /></a>
</li>
</ul>
我想改變內容通過CSS的HTML內的img標籤。我該怎麼做 ?有什麼建議?
請查看此鏈接:你可以幫助這個鏈接。 [鏈接1](https://stackoverflow.com/questions/18032220/css-change-image-src-on-imghover)[鏈接2](https://stackoverflow.com/questions/18813299/changing-image -on-hover-with-css-html) –
「img tag」的含義是什麼意思?你的意思是'src'屬性? –
這是不可能的,只能通過CSS來改變圖像源。 – Chris