<div id="id" contenteditable="true" class="aspect-ratio-box">9</div>
html, body{
background: #000;
}
.aspect-ratio-box {
background: yellow;
position: absolute;
display: flex;
align-items: center;
justify-content: center;
border-radius: 100%;
padding: 5px;
min-width: 1.2em;
box-shadow: 0 0 10px 0 yellow;
}
.aspect-ratio-box::before {
content: "";
width: 1px;
margin-left: -1px;
float: left;
height: 0;
padding-top: 100%;
}
.aspect-ratio-box::after { /* to clear float */
content: "";
display: table;
clear: both;
}
setTimeout(()=>id.focus(), 1000)
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.