I have a draggable div element with a hover style. This works fine, but the div contains some form elements (label, input). The problem is that when the mouse is over these child elements the hover is disabled.
<div class="app_setting"> <label">Name</label> <input type="text" name="name"/> </div> .app_setting:hover { cursor:move; }
Any ideas how to get the hover to apply also to the child elements?
Add :hover to the <div> tag and specify the background property. Set :hover and padding-bottom to the <p> element inside the <div> tag. Also, specify the background. Set the position to “absolute” and specify the bottom for the <button> element inside the <div> tag.
If You want to get list only children elements with id or class, avoiding elements without id/class, You can use document. getElementById('container'). querySelectorAll('[id],[class]'); ... querySelectorAll('[id],[class]') will "grab" only elements with id and/or class.
When designing and developing web applications, sometimes we need to select all the child elements of an element except the last element. To select all the children of an element except the last child, use :not and :last-child pseudo classes.
.app_setting *:hover { cursor:move }
At least 2 ways of doing it:
*
selector, as suggested by garrow .class *:hover
.class:hover *
There are probably others
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With