Is there a pure CSS way to make an input transparent?

前端 未结 7 625
有刺的猬
有刺的猬 2021-01-30 10:39

How can I make this input transparent?


I\'ve tried this but it doesn\'t work.

backgro         


        
7条回答
  •  失恋的感觉
    2021-01-30 10:57

    The two methods previously described are not enough today. I personnally use :

    input[type="text"]{
        background-color: transparent;
        border: 0px;
        outline: none;
        -webkit-box-shadow: none;
        -moz-box-shadow: none;
        box-shadow: none;
        width:5px;
        color:transparent;
        cursor:default;
    }
    

    It also removes the shadow set on some browsers, hide the text that could be input and make the cursor behave as if the input was not there.

    You may want to set width to 0px also.

提交回复
热议问题