开发者

How to make a textbox indistinguishable from the background?

Which css should I apply to textbox that make it same as background means user does not feel like 开发者_JAVA技巧he is typing in textbox? I tried giving same background color but it still doesn't provide exact what I want. User still can feel that it's a textbox.


Do you mean like this?

input {
    border: 0;
    background: transparent /* the important bit */
}

Live Demo (I added a blue border on a parent element so you can see where the <input> is)
http://jsfiddle.net/eUmr2/1/ (with gradient background to more easily see the transparent)


Appears to work in IE6:

How to make a textbox indistinguishable from the background?


If I understand your question correctly, you should first of all "hide" borders of textarea or input field. You can simply use "border:none;" property for this. In this case, if both backgrounds will be the same (e.g. textarea and rest of the container) it will be displayed like you need.

I don't know exactly what are you trying to achieve, but this method is used usually for not standard designs of form fields. The only you need to do is to be sure that this part of your page is OK from usability point of view.

Good luck!


Remove the borders and apply the same background color as the container it's in.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜