nevblanc79
09-06-2011, 02:59 PM
Hello,
I have a div containing four images sitting black and white that I want to change to colour on hover. The first one works fine, however the when I try to apply a new class name to the next image to incorporate the same style elements as the first picture it doesn't work.
I thought it would be a case of merely changing the class to ensure that the relevant image would appear when hovered over.
Could someone help?
I have attached the html along with the css
<div id="recent-work">
<h3>Our Titles</h3>
<div class="one_fourth">
<a href="portfolio_item.html" class="over"></a>
<a href="portfolio_item.html"><img src="img/pictures/envirotecover.png" alt></a>
</div>
<div class="one_fourth">
<a href="portfolio_item.html" class="over1"></a>
<a href="portfolio_item.html"><img src="img/pictures/grocerover.png" alt></a>
</div>
<div class="one_fourth">
<a href="portfolio_item.html" class="over"></a>
<a href="portfolio_item.html"><img src="img/pictures/plantover.png" alt></a>
</div>
<div class="one_fourth last">
<a href="portfolio_item.html" class="over"></a>
<a href="portfolio_item.html"><img src="img/pictures/projectscotlandover.png" alt></a>
</div>
<div class="clear"></div>
<a href="#" class="goto">View Portfolio →</a>
</div>
.over { opacity:0; filter: alpha(opacity = 0); position:absolute; background:#fff url(../img/pictures/envirotec.png) no-repeat right bottom; }
.over:hover { text-decoration:none; color:#666; }
.over span { font-size:22px; color:#7fc354; display:block; margin:10px 10px 5px 10px;}
.over p { margin:0px 10px; color:#7fc354; }
Thanks,
nevblanc79
I have a div containing four images sitting black and white that I want to change to colour on hover. The first one works fine, however the when I try to apply a new class name to the next image to incorporate the same style elements as the first picture it doesn't work.
I thought it would be a case of merely changing the class to ensure that the relevant image would appear when hovered over.
Could someone help?
I have attached the html along with the css
<div id="recent-work">
<h3>Our Titles</h3>
<div class="one_fourth">
<a href="portfolio_item.html" class="over"></a>
<a href="portfolio_item.html"><img src="img/pictures/envirotecover.png" alt></a>
</div>
<div class="one_fourth">
<a href="portfolio_item.html" class="over1"></a>
<a href="portfolio_item.html"><img src="img/pictures/grocerover.png" alt></a>
</div>
<div class="one_fourth">
<a href="portfolio_item.html" class="over"></a>
<a href="portfolio_item.html"><img src="img/pictures/plantover.png" alt></a>
</div>
<div class="one_fourth last">
<a href="portfolio_item.html" class="over"></a>
<a href="portfolio_item.html"><img src="img/pictures/projectscotlandover.png" alt></a>
</div>
<div class="clear"></div>
<a href="#" class="goto">View Portfolio →</a>
</div>
.over { opacity:0; filter: alpha(opacity = 0); position:absolute; background:#fff url(../img/pictures/envirotec.png) no-repeat right bottom; }
.over:hover { text-decoration:none; color:#666; }
.over span { font-size:22px; color:#7fc354; display:block; margin:10px 10px 5px 10px;}
.over p { margin:0px 10px; color:#7fc354; }
Thanks,
nevblanc79