Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE html>
<head>
<title>drawElementImage respects CSS object-fit on nested canvases - reference</title>
<style>
#outer {
width: 400px;
height: 300px;
background-color: green;
display: grid;
place-items: center;
}
#inner {
width: 300px;
height: 300px;
background-color: blue;
display: grid;
place-items: center;
}
#square {
width: 60px;
height: 60px;
background-color: yellow;
}
</style>
</head>
<body>
<div id="outer">
<div id="inner">
<div id="square">
</div>
</div>
</div>
</body>