padding a text input in IE… possible?

前端 未结 9 1370
逝去的感伤
逝去的感伤 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:46

    You'll have to use float: left/right on '#mainPageSearch input' before you can apply padding/margin.

    0 讨论(0)
  • 2020-12-14 08:59

    There is a css only fix for it

    div.search input[type="text"] {
        width: 110px;
        margin: 0;
        background-position: 0px -7px;
        text-indent:0;
        padding:0 15px 0 15px;
    }
    /*ie9*/ div.search input[type="text"] {
        border-left: 25px solid transparent;
    }
    /*ie8*/ div.search input[type="text"] {
        border-left: 25px solid transparent;
        background-position-x: -16px;
        padding-left: 0px;
        line-height: 2.5em;
    }
    

    Thanks Muhammad Atif Chughtai

    0 讨论(0)
  • 2020-12-14 09:00

    I had this issue also i solved it by adding the following line

    input 
    {
        overflow:visible;
        padding:5px;
    }
    

    hope this helps? Let me know.

    0 讨论(0)
提交回复
热议问题