Text indent is not working in ie7

前端 未结 14 2086
礼貌的吻别
礼貌的吻别 2021-01-31 09:43

I am working on a website and on the top navigation bar there is a search box, I applied the following css on the search submit button

#submit {
   background:          


        
14条回答
  •  渐次进展
    2021-01-31 10:07

    while implementing the image replacement technique like above, there are some rules to go with css to get it work on IE browsers.

    css declaration:

    text-indent:-9999px;
    text-transform:capitalize;
    
    
    font-size:0;
    display:block;
    line-height:0;
    

    font-size:0 is used to reduce the font size and works well in IE7. But even after adding this line, you would notice a black line(which is basically the text) on the center of the button in IE6.

    display:block Negative text-indent works in IE only if this is added.

    line-height:0 Another fix for IE6.

    text-transform:capitalize I don't know the exact reason of including the property, somehow it fixes the issue.

    Hope this helps.

提交回复
热议问题