开发者

css hide button until div hover

开发者 https://www.devze.com 2023-04-08 04:12 出处:网络
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 f

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消