Text indent is not working in ie7

前端 未结 14 1748
礼貌的吻别
礼貌的吻别 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:31

    Sorry a little late to the post, but was looking for a solution to the IE7 issue with negative text-indent. I started trying my own random ways and stumbled upon this. jUst wanted to post it out on Stack in case it may help others.

    Trying to add an icon to a link and not show the text.

    My CSS for all browsers

    a.lnk_locked , a.lnk_notchecked, a.lnk_checked
    { background: url(../images/icons/icon_sprites.png) no-repeat; padding: 0 2px 0 0;   width:18px; height:18px; 
           vertical-align:middle; text-indent:-9009px; display:inline-block; overflow: hidden; zoom: 1; *display:inline;}
        a.lnk_locked    { background-position: -1px -217px; }
    

    My CSS just for IE7

    a.lnk_locked , a.lnk_notchecked, a.lnk_checked
    {  text-indent:20px; padding-left:-20px; width:18px;}
    

提交回复
热议问题