user2609980
user2609980

Reputation: 10484

How to make input-field seem like regular text

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?

Upvotes: 3

Views: 6169

Answers (2)

Wouter
Wouter

Reputation: 430

I'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.

Upvotes: 7

Daniel A. White
Daniel A. White

Reputation: 190943

Have you tried

background-color: #fff

?

Upvotes: 0

Related Questions