Skip to content

Instantly share code, notes, and snippets.

@fredsted
Last active October 9, 2020 23:06
Show Gist options
  • Save fredsted/7147450 to your computer and use it in GitHub Desktop.
Save fredsted/7147450 to your computer and use it in GitHub Desktop.
Mac OS X-style button in CSS, live: http://mu.ms/f/tc.html
<!DOCTYPE html>
<html lang="en">
<head>
<style>
.osxbutton {
text-decoration: none;
font-family:".LucidaGrandeUI", "Lucida Grande", "Lucida sans unicode";
color: black;
font-size: 11px;
padding: 1px 7px;
border:1px solid #9C9C9C;
margin: 2px 2px;
display: inline-block;
background-image: -webkit-linear-gradient(
#ffffff 0%, #F6F6F6 30%,
#F3F3F3 45%, #EDEDED 60%,
#eeeeee 100%);
border-radius: 3px;
cursor: default;
box-shadow: 0px 0px 1px rgba(0,0,0,0.20);
}
.osxbutton:active {
border-color:#705ebb;
background-image:-webkit-linear-gradient(
#acc5e9 0%, #a3c0f2 18%,
#61a0ed 39%, #55a3f2 70%,
#82c2f1 91.72%, #9AD2F2 100%);
box-shadow: 0px 0px 1px rgba(0,0,0,0.65);
}
.osxbutton.disabled {
color: #999!important;
background-image: -webkit-linear-gradient(#fbf8f8 0%, #f0f0f0 30%, #e3e3e3 45%, #d7d7d7 60%, #cbc9c9 100%);
}
</style>
</head>
<body>
<button>I'm a button</button>
<br>
<a class="osxbutton disabled" href="#">I'm disabled</a>
<br>
<a class="osxbutton" href="#">Click me!</a>
</body>
</html>
@osbre
Copy link

osbre commented Jul 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment