I have a readonly HTML <input>
that I'd like to display just like a <span>
.
However, applying the following CSS causes it to stay as inline-block
in Chrome v34 on Windows.
input[readonly] {
background:none; color:inherit; /* normal colors */
border:0; margin:0; padding:0; /* no special sizing */
width:auto; display:inline; /* try to make it inline and auto-size */
}
Demo: http://jsfiddle.net/52vL3/
How can I make the input stop requiring an explicit size, using CSS?