JSFiddle - React, Tailwind, and code Playground
by Anderson Madeira
HTML
<div class="wrapper">
<div contenteditable="true" spellcheck="false" class="code">
</div>
<span class="linenumbers">
1<br>
2<br>
3<br>
4<br>
</span>
<span class="toggle">
T
</span>
</div>
CSS
* {
margin: 0px;
padding: 0px;
}
.wrapper {
position: absolute;
margin: 15px;
margin-right: 0px;
height: 500px;
background: blue;
}
.linenumbers, .code {
line-height: 20px;
font-size: 20px;
padding: 5px;
font-family: Monospace;
}
.linenumbers {
position: absolute;
left: 0px;
top: 0px;
background-color: #eee;
margin: 1px 0px 1px 1px;
}
.code {
background-color: red;
width: 500px;
height: 500px;
position: absolute;
border: 1px dashed #999;
outline:0;
padding-left: 30px;
}
.toggle {
z-index: 100;
background: blue;
}