Use the below selector
button {
display: none; /* Hide button */
}
.divbutton:hover button {
display: block; /* On :hover of div show button */
}
Demo
Also make sure you assign some height
or min-height
to your div
element, else it will be 0
as it doesn't hold any content. Also, don't use display: none;
as inline style, as inline styles have highest specificity, and hence, you will be forced to use !important
which is bad.
In the above example am using button {/*Styles*/}
but that is a general element selector, so make sure you define a class
to your button
element.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…