Im trying to create a text field which is readonly but it should not look like a text field.
The normal readonly text field is
Your name is [ SAM ]
but I want it like
Your name is SAM
That is it should look like the continuation of the sentence and can still act as a text field on to which we can show value (here SAM). Any way to do that?
What your looking for is this:
Your name is <input type="text" value="SAM" readonly="readonly" />
input {
border: 0;
}
You can set the input field to readonly
in the HTML, this will make it so you cannot edit the field. Then you want to get rid of the border to so it makes it look like its apart of the text. Then customise it as you see fit.
DEMO HERE
If the input is in a div/span you can just the inputs within that div
/span
like so:
<span class="test">Your name is <input type="text" value="SAM" readonly="readonly" /></span>
.test input {
border: 0;
}
DEMO HERE
to style all readonly textboxes apply following CSS rule
input[readonly="readonly"] {
border:0px;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With