Skip to content

Instantly share code, notes, and snippets.

@sandipchitale
Created April 4, 2019 16:14
Show Gist options
  • Save sandipchitale/b01dbb92f1cc59e82fcf02eb3db3adec to your computer and use it in GitHub Desktop.
Save sandipchitale/b01dbb92f1cc59e82fcf02eb3db3adec to your computer and use it in GitHub Desktop.
Layers
<html>
<head>
<style>
html,
body {
top: 0;
left: 0;
}
.bordered {
border: 1px solid black;
background-color: lightgray;
max-width: 512px;
max-height: 512px;
overflow: auto;
margin: auto;
}
.scaled {
display: inline-block;
transform-origin: 50% 50%;
transform: translate(-100%, -100%);
transform: scale(.25, .25);
}
.layer-container {
display: grid;
justify-items: unsafe center;
align-items: unsafe center;
grid-template-columns: 1fr;
overflow: auto;
cursor: crosshair;
}
.layer {
grid-row-start: 1;
grid-column-start: 1;
}
</style>
</head>
<body>
<div class="bordered">
<div class="scaled">
<div class="layer-container">
<img src="es.jpg" class="layer" />
<img src="et.jpg" class="layer" />
</div>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment