html - Unexpected gap between columns with absolute positioned elements -
i trying make line have 3 columns have hover effect shows item description.
on google chrome, when hover first item, gap appears between second , third column. on mozilla firefox same thing happens when it's 4 or 2 columns instead of three, gap appears between 2 last items.
markup
<div class="row row-3"> <div class="column"> <img src="http://placehold.it/800x650" alt="" class="image" /> <div class="info"> <p class="description">lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> </div><!-- .info --> </div><!-- .column --> <div class="column"> <img src="http://placehold.it/800x650" alt="" class="image" /> <div class="info"> <p class="description">lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> </div><!-- .info --> </div><!-- .column --> <div class="column"> <img src="http://placehold.it/800x650" alt="" class="image" /> <div class="info"> <p class="description">lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> </div><!-- .info --> </div><!-- .column --> </div><!-- .row -->
css
body { font: normal 0.7em sans-serif; } .row { width: 100%; } .image { max-width: 100%; } .info { background: rgba(0, 0, 0, .5); color: #fff; height: 100%; left: 0; opacity: 0; position: absolute; top: 0; transition: .3s linaer; width: 100%; -webkit-transition: .3s linear; -moz-transition: .3s linear; -ms-transition: .3s linear; -o-transition: .3s linear; } .column:hover .info { opacity: 1; } } .column { position: relative; } .row-3 .column { float: left; width: 33.333333%; }
i made fiddle show issue: http://jsfiddle.net/q5z4b/1/
the problem 33.333333% have use width. browser takes time calculate "100%" of "33.33333%" image needs fill container.
probably if change image width 100.1% insteed of 100% may work
Comments
Post a Comment