最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to make input-field seem like regular text - Stack Overflow

programmeradmin0浏览0评论

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 0
Add a ment  | 

2 Answers 2

Reset to default 7

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.

Have you tried

background-color: #fff

?

发布评论

评论列表(0)

  1. 暂无评论