0

I'm designing a site, where I have elements with a link on them. I want this so that a visitor can click anywhere on the article to be linked to the page. The code I have is:

<article class="pfitem"><a href="research.php">
<img class="pfcover" src="Images/pfresearch.png" />
<p class="pfcaption">Research Papers</p>
</a></article>

I want the text which says "Research" to have a purple background when people hover the article because this is what I have throughout all the text links on the site. I tried with CSS to style this using the class "pfcap

4

2 に答える 2

2

次のように書くことができます。

.pfitem:hover a .pfcaption{
 background:red;
}
于 2013-01-23T07:59:39.017 に答える
0

次の CSS が機能するはずです。

.pfcaption:hover {
    background-color: #d9f;
}
于 2013-01-23T08:20:49.487 に答える