Posted By

jessibird on 08/18/09



Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Hide submit button text

 / Published in: CSS


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.

  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. }

Report this snippet  

You need to login to post a comment.