Skip to content

Instantly share code, notes, and snippets.

@vitkarpov
Created May 16, 2017 12:32
Show Gist options
  • Save vitkarpov/1b26f578273ca1c732c0aff440adc426 to your computer and use it in GitHub Desktop.
Save vitkarpov/1b26f578273ca1c732c0aff440adc426 to your computer and use it in GitHub Desktop.
Untitled
.my-fancy-input {
position: relative;
width: 160px;
height: 20px;
border: 1px solid black;
}
.my-fancy-input input {
position: absolute;
background: transparent;
box-sizing: border-box;
width: 160px;
height: 20px;
border: 0;
padding: 0 6px;
font-size: 18px;
letter-spacing: 9px;
}
.my-fancy-input-square {
position: absolute;
left: 0;
top: 0;
width: 20px;
height: 20px;
border-left: 1px solid black;
}
.my-fancy-input-square:nth-child(1) { left: 0; border-left: 0; }
.my-fancy-input-square:nth-child(2) { left: 20px; }
.my-fancy-input-square:nth-child(3) { left: 40px; }
.my-fancy-input-square:nth-child(4) { left: 60px; }
.my-fancy-input-square:nth-child(5) { left: 80px; }
.my-fancy-input-square:nth-child(6) { left: 100px; }
.my-fancy-input-square:nth-child(7) { left: 120px; }
.my-fancy-input-square:nth-child(8) { left: 140px; }
<div class="my-fancy-input">
<div class="my-fancy-input-square"></div>
<div class="my-fancy-input-square"></div>
<div class="my-fancy-input-square"></div>
<div class="my-fancy-input-square"></div>
<div class="my-fancy-input-square"></div>
<div class="my-fancy-input-square"></div>
<div class="my-fancy-input-square"></div>
<div class="my-fancy-input-square"></div>
<input type="text" value="12345678" readonly>
</div>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment