I'm trying to achieve the transition effect like in the img/links in this website : verena michelitsch.
This is what I've tried until now :
HTML :
<div id="centerpiece">
<div id="photography"><a href="photography.html">Photography</a></div>
<div id="painting"><a href="painting.html">Paintings</a></div>
<div id="sketches"><a href="sketches.html">Sketches</a></div>
<div id="digitalpainting"><a href="digitalpainting.html">Digital Paintings</a></div>
</div>
CSS :
#centerpiece div {
border: 10px solid gray;
border-radius: 100%;
background-image: url(images/viraj.jpg);
line-height: 300px;
text-align: center;
vertical-align: middle;
opacity: 1;
transition: opacity 0.5s ease-in-out;
-moz-transition: opacity 0.5s ease-in-out;
-webkit-transition: opacity 0.5s ease-in-out;
}
#centerpiece div a {
display: block;/*to extend to div boundary*/
height: 300px;
border-radius: 100%;
font-family: Existence Light, Aaargh, Arial, Helvetica, sans-serif;
font-size: 30px;
font-weight: 700;
text-decoration: none;
color: white;
text-transform: uppercase;
opacity: 0;
transition: opacity 0.5s ease-in-out;
-moz-transition: opacity 0.5s ease-in-out;
-webkit-transition: opacity 0.5s ease-in-out;
}
#centerpiece div:hover {
opacity: 0.5;
}
#centerpiece div a:hover {
opacity: 1;
}
While the transition occurs for the text(within the a
element), it's opacity
property is ultimately set to 0.5 and not 1, even though it should as I wrote the CSS rule for #centerpiece div a
after #centerpiece div
.
How can make the final opacity
equal to 1 ?