Source code
Revision control
Copy as Markdown
Other Tools
<?xml version="1.0" encoding="utf-8"?>
<head>
<title>Drag and drop of overlapping elements: negative margins</title>
<style type="text/css">
div
{height:100px;
width:100px;
margin-top:-50px;
background-color:navy;}
div:nth-child(odd)
{background-color:maroon;
margin-left:50px;}
div[draggable]
{background-color:teal;}
</style>
</head>
<body>
<div/>
<div/>
<div draggable="true"/>
<div/>
<div/>
<div draggable="true"/>
<div/>
<div/>
<p>Only green areas should be draggable.</p>
</body>
</html>