Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<style>
.box {
position: absolute;
z-index: 0;
will-change: transform;
contain: strict;
}
#scope {
position: absolute;
background: #eee;
left: 40px;
top: 40px;
width: 490px;
height: 190px;
}
.part {
left: 30px;
top: 30px;
width: 120px;
height: 120px;
background-color: purple;
transform: translateX(150px);
outline: 5px solid green;
}
</style>
</head>
<body>
<div id=scope class=box>
<div class="part box"></div>
</div>
</body>
</html>