How do you make a border with some gap so that arbitrary text can get in (without hard coding the background color/image). Also without altering the HTML
My attempt so far
https://codepen.io/anon/pen/ZZVMBx#anon-login
$primary-color: blue;
$border-color: blue;
$base-font-size: 16px;
label {
position: relative;
span {
position: absolute;
display: block;
color: $border-color;
left: 10px;
right: 0;
top: -8px;
font-size: 14px;
}
input {
position: absolute;
border: 2px solid $border-color;
border-radius: 4px;
padding: 8px;
z-index: -1;
font-size: $base-font-size;
}
}
<label>
<span>label</span>
<input type="text" value="hello">
</label>
Similar to Text in Border CSS HTML except that I have noted that I do not want the background to be changed. The accepted answer and answers provided set the background white.