Skip to content

Instantly share code, notes, and snippets.

@Wowfunhappy
Created September 20, 2026 15:02
Show Gist options
  • Select an option

  • Save Wowfunhappy/6fe8d944e938a691d4c876768eec8175 to your computer and use it in GitHub Desktop.

Select an option

Save Wowfunhappy/6fe8d944e938a691d4c876768eec8175 to your computer and use it in GitHub Desktop.
WebKit Depth Order Test
<!doctype html>
<meta charset="utf-8">
<title>CSS 3D: non-intersecting depth order</title>
<style>
#scene {
position: relative;
width: 240px;
height: 180px;
margin: 40px;
transform-style: preserve-3d;
}
#red {
position: absolute;
left: 60px; top: 50px;
width: 120px; height: 80px;
background: rgb(220, 40, 40);
transform: translateZ(40px);
}
#blue {
position: absolute;
left: 10px; top: 10px;
width: 220px; height: 160px;
background: rgb(40, 90, 220);
transform: translateZ(20px);
}
</style>
<p>Expected: a red rectangle in front of a larger blue rectangle.</p>
<div id="scene">
<div id="red"></div>
<div id="blue"></div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment