In an ASP.NET application I have a lot of textbox controls that are displayed as readonly input fields. I want them to look like plain text. I tried a few things with styling and I have no luck so far (for example the disable attribute makes the text gray as well, and I am not sure if this works well with the ASP.NET databinding).
Is there a way to use styling/jquery to make an input field look like a plain text field?
In an ASP.NET application I have a lot of textbox controls that are displayed as readonly input fields. I want them to look like plain text. I tried a few things with styling and I have no luck so far (for example the disable attribute makes the text gray as well, and I am not sure if this works well with the ASP.NET databinding).
Is there a way to use styling/jquery to make an input field look like a plain text field?
Share Improve this question asked May 13, 2014 at 17:41 user2609980user2609980 10.5k17 gold badges84 silver badges147 bronze badges 02 Answers
Reset to default 7I'm not entirely sure what you are trying to achieve, you want an input field that is disabled look like plain text? I guess something like this should do:
HTML:
<input type="text" value="This is an example." disabled="disabled"/>
CSS:
input[type="text"]{
border: none;
background: transparent;
color: #000;
}
JSFIDDLE to check online.
Have you tried
background-color: #fff
?