I have a textfield in my HTML with white bottom border when focused and I want it to change width of the textfield to the length of the current text in it (with some limit of course). I tried css min-width and max-width, but it seems to do nothing. I think implementing it with JS would need a hardcoded width table, which I don't want to do.
EDIT:
It's just simple CSS, but here's the code:
#container {
width: 100%;
height: 52px;
background: #673ab7;
}
#textbox {
font-family: sans-serif;
font-size: 20px;
font-weight: bold;
color: white;
background: none;
border: none;
vertical-align: top;
margin-top: 13px;
margin-left: 13px;
outline: none;
}
#textbox:focus {
border-bottom: 2px solid white;
}
<div id="container">
<input type="text" id="textbox" placeholder="placeholder" />
</div>