我只是設法圍繞父母/孩子懸停行動(主要),但我遇到了這個問題。兒童元素出現在img
我在父元素(category-links)的懸停上顯示的子元素(h3.test)中有一個箭頭。問題在於箭頭出現在(img.art-icons)元素後面。我知道我可能在這裏做了一些遲緩的事情,但是誰能爲我說明一些情況?
這裏是小提琴http://jsfiddle.net/plaedien/mN7mZ/
CSS
.button {
width: 225px;
margin: 0 auto;
}
a.category-links{
display: block;
position: relative;
border: 1px solid #F0F5F5;
}
h3.test{
padding-top: 11px;
padding-bottom: 11px;
background-color: #cbcbcb;
font-family: 'Source Sans Pro', sans-serif;
color: white;
font-size: 23px;
font-weight: 600;
text-align: center;
list-style-type: none;
}
a.category-links:hover h3.test{
background: url(http://kmmedia.com.au/~~test/images/yellow-arrow.png) #b61f25 center 45px no-repeat;
position: relative;
color: #fff;
z-index: 100;
}
.art-icons {
display: block;
margin: 30px auto;
z-index: 1;
}
.category-text {
font-family:'Source Sans Pro', sans-serif;
color: #4d4d4d;
font-size: 15px;
line-height: 24px;
text-align: center;
}
HTML
<div class="button">
<a class="category-links">
<h3 class="test">Hapkido</h3>
<img class="art-icons" src="http://kmmedia.com.au/~~test/images/hapkido-icon.png" alt="pic">
<div class="category-text">Do you want to learn practical<br>self-defence skills? Then Hapkido is the martial art for you!</div>
</a>
</div>
在閱讀所有答案後,我意識到我對自己的工作並不清楚。你是對的,我試圖讓箭頭顯示在h3下。感謝您的幫助:) – Plaedien
沒有問題,很高興我可以幫助,只是在我的答案中發現了一個錯字 - 在'display:block'行中不應該有@ @ – Pete