text-indent on submit buttons

/ Published in: CSS
Save to your folder(s)

IE not interpreting text-indent on submit buttons ?

How it works
Let’s see how it works.
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.

Copy this code and paste it in your HTML
  1. input.button{
  2. width:114px;
  3. height:37px;
  4. border: none;
  5. background: transparent url(images/submit_btn.gif) no-repeat center;
  6. overflow: hidden;
  7. text-indent: -999px;
  8. font-size: 0;
  9. display:block;
  10. line-height: 0;
  11. }

URL: http://www.productivedreams.com/ie-not-intepreting-text-indent-on-submit-buttons/

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.