css3 - How to make entire div change color on hover using css? -
i have following:
<div id="side-menu" class="sidebar-nav span2"> <div class="sidebar-link"><span>link 1</span></div> <div class="sidebar-link"><span>link 2</span></div> </div>
i'm trying make each of 2 divs change color when hover on them - whether hover on text of off right or left of text. color changes if hover on text. idea how can done? here's fiddle css:
you have space in hover selector. matters because space descendant selector in css
div.sidebar-link :hover{ background-color: #e3e3e3; }
this means hovered descendants of .sidebar-link
affected rules. remove space.
Comments
Post a Comment