4

I've found a very strange thing.

I was complaining about it before, but nobody sees old questions here.

Here's an example.

It works perfectly in Opera only... In Firefox, Chorme, Safari and IE8 there's a border around this button... And I have no idea WHY? How to delete the border?

Thanks.

Cyril Gandon
  • 16,830
  • 14
  • 78
  • 122
fomicz
  • 1,752
  • 7
  • 25
  • 33
  • 2
    Exact duplicate of [Submit image border in Safari and Chrome?](http://stackoverflow.com/questions/3708748/submit-image-border-in-safari-and-chrome). Wait more than four hours before giving up on having a question answered, please, and even then you should never submit an exact duplicate. – Ben Blank Sep 14 '10 at 16:32
  • No ideas here. I'll keep looking, though. – Ryan Kinal Sep 14 '10 at 16:32
  • @Ben, agreed. Is there a way to vote-to-merge? The answers here seem more useful than those in the other. – David Thomas Sep 14 '10 at 16:37
  • @David — Not that I'm aware of, but that sounds like a good thing to suggest on Meta! ;-) – Ben Blank Sep 14 '10 at 16:41

2 Answers2

2

Thats because you have set a type of image and not defined an image url... you have set the background image using CSS.

Change your element to a span or such and this will fix the issue, also add cursor to be a pointer in css too, this will give the user the idea to click it. then use an onclick event for the submit.

JamesStuddart
  • 2,581
  • 3
  • 27
  • 45
  • Further to this, if you change the `type="image"` to `submit` or `reset` the border disappears. Also, would the ` – David Thomas Sep 14 '10 at 16:28
  • incorrect, defining background images for elements should be done in CSS, the only time you should use image tags is to show external images, this is the way search engines discover images for the image search. – RobertPitt Sep 14 '10 at 16:28
  • Your comment is completely off topic? an image has been define with NO actual image url therefore the browsers are complaining there is a missing image. background images should be defined with CSS yes! but that is not what is being discussed here... – JamesStuddart Sep 15 '10 at 08:05
0

As others have noted, you have defined an "image"-style button but not provided a source URL, resulting in a broken image.

The simplest solution is to change type="image" to type="button", which removes the broken image icon and border.

Ben Blank
  • 54,908
  • 28
  • 127
  • 156