Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a textbox indistinguishable from the background?

Tags:

css

textbox

Which css should I apply to textbox that make it same as background means user does not feel like 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.

like image 595
Harry Joy Avatar asked Dec 07 '25 06:12

Harry Joy


2 Answers

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:

enter image description here

like image 80
thirtydot Avatar answered Dec 10 '25 04:12

thirtydot


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!

like image 32
Tomasz Libich Avatar answered Dec 10 '25 04:12

Tomasz Libich



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!