css hide button until div hover
We want to hide button until we hover over the div layer.
FIDDLE here > Click to view
Essentially, I would like to 开发者_如何学Pythonbe able to apply this to other elements also, but this will do for now, any help appreciated
Simply use the :hover
pseudo-class on the outer div:
.resultContainer .viewThisResult {
display: none;
}
.resultContainer:hover .viewThisResult {
display: inline;
}
Here's the fiddle: http://jsfiddle.net/dTLaF/1/
.resultContainer:hover .viewThisResult { display: block; }
:hover
pseudoselector on the parent. Though it's nice when the code for the question is included in the question, for posterity.
when using this feature and trying to hover most of the time it doesn't work because when something is hidden it is no longer there to activate hover, the simplest way to solve this is by making it transparent and using hover to remove the transparency.
精彩评论