As far as I know, this can only be achieved with JS, however you can try this - JSFiddle .
HTML
<div class="iban"> <input type="text" value="CZ5220100000000123456789" /> <span>CZ52 2010 0000 0001 2345 6789</span> </div>
CSS
.iban { position: relative; } .iban span { position: absolute; margin-right: 0.5em; padding: 1em; } .iban:hover span { display: none; } .iban input { display: none; } .iban:hover input { display: inline; } input { position: absolute; padding: 1em; } .iban span, input { font-family: Tahoma; font-size: 12px; width: 200px; border: 1px solid gray; }
Note. I have not tested if this works on mobile devices / touch screens. I recommend using some kind of JS solution. If the user changes the text in the input, the text in the range does not change.
source share