html - Css transition with background-color -
i've got image dark overlay on hover. works, want background slide in . i've tried doing transitions , background shows, doesn't slide in. code
html
<div class="products_overlay"> <a href="<?php echo $_product->getproducturl() ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(200); ?>" class="hover_test" /></a> <ul> <li> <?php echo $_product->getdata(‘price’); ?></li> <li> <?php echo $_product->getattributetext(‘desc); ?></li> <li> <?php echo $_product->getattributetext('country'); ?></li> </ul> </div>
css
.hover_test { position: relative; } .products_overlay:hover:after { content: ""; position: absolute; top: 0; left: 0; bottom: 0; right: 0; background-color: rgba(0, 0, 0, 0.8); -webkit-transition: background-color .5s ease-in; -moz-transition: background-color .5s ease-in; -o-transition: background-color .5s ease-in; -ms-transition: background-color .5s ease-in; transition: background-color .5s ease-in; }
any suggestion on how this?
try this:
.hover_test {position:relative;} .products_overlay:after { content:""; position:absolute; top:0; left:0; bottom:0; right:0; background: rgba(0, 0, 0, 0.8); overflow: hidden; -webkit-transition: 0.5s; -moz-transition: 0.5s; -o-transition: 0.5s; transition: 0.5s; width:0; } .products_overlay:hover:after{ width:100%; }
Comments
Post a Comment