Hide submit button text

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

Sometimes you can't use an image button, you have to use a submit button, but you still want to hide the text and show an image instead.

The width and height can be changed, of course. The point is that they are specified.

Display:block is needed for IE, according to the original article. Not sure if the font-size and line-height are strictly needed; I didn't test extensively.

Copy this code and paste it in your HTML
  1. .submitbutton {
  2. display:block;
  3. width:100px; height:25px;
  4. background-image:url(image.jpg); background-repeat:no-repeat;
  5. text-indent:-999px;
  6. font-size:0px; line-height:0;
  7. }

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.