我創建了一些圖像,當你把它們放在上面時,它們顯示一些文字在上面,到目前爲止它都工作得很好,但現在我遇到的問題是如何保持背景黑色徘徊在H2 ..任何幫助感激<span>當背景顏色在內部文字懸停
看到這裏演示http://jsfiddle.net/buNBm/2/
這是我
<a href="#">
<h2>Some Text</h2>
<span>
<img src="http://www.sheridanrogers.com.au/wp-content/uploads/2011/03/American-pancakes.jpg"/>
</span>
</a>
和CSS
img {width:250px;}
a:hover h2 {display: block!important;}
a h2 { position: absolute; top:0 ; display: none; color: #fff;}
a span {display: inline-block;}
a:hover span {background: #000}
a span img:hover, a span:hover img {visibility: hidden;}
像這樣的事情? http://jsfiddle.net/buNBm/3/ –