Remove button styles


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

Defaults buttons back to default after button styles have been specified (except Aqua buttons on Safari).


Copy this code and paste it in your HTML
  1. /* buttons */
  2.  
  3. /* Note: Values in nsNativeTheme IsWidgetStyled function
  4.   need to match button background/border values here */
  5.  
  6. button,
  7. input[type="reset"],
  8. input[type="button"],
  9. input[type="submit"] {
  10. -moz-appearance: button;
  11. /* The sum of border-top, border-bottom, padding-top, padding-bottom
  12.   must be the same here, for text inputs, and for <select>. For
  13.   buttons, make sure to include the -moz-focus-inner border/padding. */
  14. padding: 0px 6px 0px 6px;
  15. border: 2px outset ButtonFace;
  16. background-color: ButtonFace;
  17. color: ButtonText;
  18. font: -moz-button;
  19. line-height: normal !important;
  20. white-space: pre;
  21. cursor: default;
  22. -moz-box-sizing: border-box;
  23. -moz-user-select: none;
  24. -moz-binding: none;
  25. text-align: center;
  26. }
  27.  
  28. button {
  29. /* Buttons should lay out like "normal" html, mostly */
  30. white-space: inherit;
  31. text-indent: 0;
  32. }
  33.  
  34. *|*::-moz-button-content {
  35. display: block;
  36. }
  37.  
  38. button:hover,
  39. input[type="reset"]:hover,
  40. input[type="button"]:hover,
  41. input[type="submit"]:hover {
  42. background-color: -moz-buttonhoverface;
  43. color: -moz-buttonhovertext;
  44. }
  45.  
  46. button:active:hover,
  47. input[type="reset"]:active:hover,
  48. input[type="button"]:active:hover,
  49. input[type="submit"]:active:hover {
  50. padding: 0px 5px 0px 7px;
  51. border-style: inset;
  52. background-color: ButtonFace;
  53. color: ButtonText;
  54. }
  55.  
  56. button::-moz-focus-inner,
  57. input[type="reset"]::-moz-focus-inner,
  58. input[type="button"]::-moz-focus-inner,
  59. input[type="submit"]::-moz-focus-inner,
  60. input[type="file"] > input[type="button"]::-moz-focus-inner {
  61. padding: 0px 2px 0px 2px;
  62. border: 1px dotted transparent;
  63. }
  64.  
  65. button:focus::-moz-focus-inner,
  66. input[type="reset"]:focus::-moz-focus-inner,
  67. input[type="button"]:focus::-moz-focus-inner,
  68. input[type="submit"]:focus::-moz-focus-inner,
  69. input[type="file"] > input[type="button"]:focus::-moz-focus-inner {
  70. border-color: ButtonText;
  71. }
  72.  
  73. button[disabled]:active, button[disabled],
  74. input[type="reset"][disabled]:active,
  75. input[type="reset"][disabled],
  76. input[type="button"][disabled]:active,
  77. input[type="button"][disabled],
  78. select[disabled] > input[type="button"],
  79. select[disabled] > input[type="button"]:active,
  80. input[type="submit"][disabled]:active,
  81. input[type="submit"][disabled] {
  82. /* The sum of border-top, border-bottom, padding-top, padding-bottom
  83.   must be the same here and for text inputs */
  84. padding: 0px 6px 0px 6px;
  85. border: 2px outset ButtonFace;
  86. color: GrayText;
  87. cursor: inherit;
  88. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.