:-moz-drag-over {
/* ... */
}`:-moz-drag-over` CSS pseudo-class / notebook
`:-moz-drag-over` CSS pseudo-class
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
<div id="drop-target">
<p>Drop target</p>
</div>
<div draggable="true">
<p>Draggable</p>
</div>body {
font-family: "Arial";
}
div {
display: inline-block;
width: 150px;
height: 150px;
border: 2px dotted black;
background-color: aquamarine;
margin: 1rem;
}
p {
padding: 1rem;
}#drop-target {
background-color: cornflowerblue;
}
#drop-target:-moz-drag-over {
background-color: red;
}const target = document.getElementById("drop-target");
/* dragenter event fired on the drop target */
target.addEventListener("dragenter", (event) => {
// prevent default to allow drop
event.preventDefault();
});