padding a text input in IE… possible?

前端 未结 9 1394
逝去的感伤
逝去的感伤 2020-12-14 07:54

I have a text input with a search buton absolute positioned over it... to make space for the button I used some padding to keep the text from going under the button, which i

9条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-14 08:45

    Make your input transparent and place styles inside a container div:

    http://jsfiddle.net/LRWWH/211/

    HTML

     

    CSS

     .input-container {
        background:red;
        overflow:hidden;
        height: 26px;
        margin-top:3px;        
        padding:6px 10px 0px;
        width: 200px;
      }
    
     .input-transparent {
        background-color:transparent;
        border:none;
        overflow:hidden;        
        color:#FFFFF;
        width: 200px;
        outline:none;
      }
    

提交回复
热议问题