I came across an example of revealing a hidden div which is inside an element using css only
<style type="text/css">
#shopCart:hover .shopCartDetail {
display: block;
}
</style>
<div id="shopCart">
Shop Cart
<div class="shopCartDetail"><style>.shopCartDetail {display:none}</style>
This is Shop Cart Detail</div>
</div>
Working example here http://jsfiddle.net/7DRTD/
In my scenario, the style display:none is created by jQuery. Revealing the hidden div using hover does not work: http://jsfiddle.net/Z2mtF/
What can be the issue here? The html code looks same, both examples add inline style to the div.
The question is: why does the second scenario not work?
Thank you.
<style>block inside your<div>? You know you can define both settings in the same block: jsfiddle.net/7DRTD/5 Doing it with jQuery also works: jsfiddle.net/7DRTD/6