html - Hover effect is affecting them all at once, not individually -
i have been looking through cause of problem , haven't had luck finding anything. i'm not entirely sure if own stupidity or purely lack of knowledge.
i don't know lot coding , i've had super long day may have on looked something. here basic idea of i'm trying do.
i want list of 5 options, , have block under window when rolled on shows block. (indicated colour)
now i've created when rolled on show up, why this?
here example of i've created
html
<div id="nature"> <a class="sound"> <h4>forest</h4> <div class="preview" style="background:red;"> </div> </a> <a class="sound"> <h4>storm</h4> <div class="preview"style="background:blue;" > </div> </a> <a class="sound"> <h4>winter</h4> <div class="preview"style="background:lightblue;" > </div> </a> <a class="sound"> <h4>dusk</h4> <div class="preview"style="background:pink;" > </div> </a> <a class="sound"> <h4>ocean</h4> <div class="preview"style="background:yellow;" > </div> </a> </div>
css
#nature { width: 100%; position: absolute; margin: 0; padding: 0; bottom: 0; left: 0; } .sound { margin: 0; padding: 0; width: 20%; height: 130px; display: inline-block; float: left; background: green; cursor: pointer; transition: .5s; -webkit-transition: .5s; margin-bottom: -50px; } .sound:hover { margin-bottom: 0; } .sound .preview { height: 50px; width: 100%; overflow: hidden; clear: both; margin: 50px 0 0 0; }
easiest way;
#nature > { position: relative; } .sound { bottom:-50px; } .sound:hover { bottom:0; }
fiddle: http://jsfiddle.net/u3ssv/
p.s. also, can wrap content in container overflow set hidden.. or still dont point (?) :)
Comments
Post a Comment