Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE html>
<style>
body { margin: 0; }
.parent {
position: relative;
display: flex;
width: 100%;
height: 100px;
background: red;
}
.content {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
width: 100px;
height: 100px;
background: green;
}
svg {
width: 50px;
height: 50px;
}
</style>
<div class="parent">
<div class="content">
</div>
</div>