Skip to content

Instantly share code, notes, and snippets.

@tonyhb
Created June 23, 2011 08:38
Show Gist options
  • Save tonyhb/1042160 to your computer and use it in GitHub Desktop.
Save tonyhb/1042160 to your computer and use it in GitHub Desktop.
Buttons with image backgrounds.
.button, .button span {
display: inline-block;
overflow: visible;
width: auto;
text-decoration: none;
border: 0 none;
outline: 0 none;
padding: 0;
cursor: pointer;
position: relative;
/* Change these to whatever you want! */
font-size: 12px;
height: 26px;
line-height: 26px;
}
.button span {
position: relative;
display: block;
white-space: nowrap;
}
.button::-moz-focus-inner {
border: none; /* overrides extra padding in Firefox */
}
/* Background styles*/
.button {
background: url(##URL##) no-repeat 0 0;
}
.button span {
background: url(##URL##) no-repeat 0 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment