Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • 21
    The catch to this is that it requires you to reproduce the look of a button with CSS. But unfortunately buttons on different browsers and different versions of browsers look different. So you either have to accept it looking funny in some browsers, or have a bunch of code to figure out which browser and which version the user has and choose a different style. Which is a whole lot of trouble, and could break the next time a new version of a browser comes out. Commented Dec 15, 2013 at 3:23
  • This only works for me if I apply it to a tag directly (a {display: block ...}), which is not acceptable. Do you have any idea why class attribute inside a tag won't work? :( I'm using Firefox 27. I also tried a.button {...} and it doesn't work either. Commented Feb 26, 2014 at 0:52
  • 2
    @Jay a compromise could be to define the styling of the <input type="submit"> and/or <button> elements so that they did not use the browser defaults (where possible), and then match these with the styling for .button as above. This should help reduce the differences, if not remove them completely, and is better than your (unreliable - as you rightly say) method of sniffing the browser type and version. Commented Mar 14, 2014 at 11:52
  • @OllieBennett True: You could completely redefine the look of a button. I haven't tried to do this, not sure how many aspects of the style you have to override. Sounds like a pain, but not having tried it, I can't say how much pain it is compared to other options. Commented Mar 24, 2014 at 20:02
  • @CraigGjerdingen I really like the styles you used for .link_button. The use of CSS3 definitely updates this answer. Also using styles that are less like the "regular" browser buttons, but still have a button affordance solves the problem of browser sniffing without (imo) having to also redefine the styles for <input type="submit"> Commented Nov 28, 2016 at 19:30