Skip to content

Instantly share code, notes, and snippets.

Created November 21, 2013 07:05
Show Gist options
  • Save anonymous/7577198 to your computer and use it in GitHub Desktop.
Save anonymous/7577198 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<div class="header">
<a class="btn" href="#">Click me</a>
<div class="btn-group">
<a class="btn" href="#">1</a>
<a class="btn" href="#">2</a>
<a class="btn" href="#">3</a>
<a class="btn" href="#">4</a>
</div>
</div>
<div class="content">
<a class="btn" href="#">Me too</a>
</div>
</body>
</html>
$(function() {
$('.btn').click(function(e) {
$(this).toggleClass('active');
});
});
* {
margin: 0;
padding: 0;
color: black;
text-decoration: none;
}
body {
background: url("http://i.imgur.com/1xlYob8.png");
}
.header, .content {
padding: 10px;
}
.header {
background: linear-gradient(to bottom, rgba(255,255,255,0.10) 0%,rgba(0,0,0,0.3) 100%), url("http://i.imgur.com/DfMbZCm.png");
border-bottom: 1px solid rgba(0, 0, 0, 0.9);
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}
.btn {
display: inline-block;
padding: 10px 20px;
border-radius: 6px;
border: 1px solid rgb(10, 10, 10);
box-shadow:
inset 0 0 3px rgba(255, 255, 255, 0.2),
inset 0 1px 1px rgba(255, 255, 255, 0.2),
1px 1px 2px rgba(0, 0, 0, 0.5);
font-size: 0.9em;
color: white;
text-shadow: 1px 1px 1px rgba(10, 10, 10, 0.8);
background: linear-gradient(to bottom, rgba(255,255,255,0.25) 0%,rgba(255,255,255,0) 100%), url("http://i.imgur.com/5jyWHZm.png");
&.active, &:active {
text-shadow: none;
box-shadow:
inset 0 0 8px rgba(0, 0, 0, 0.6),
0 0 1px rgba(0, 0, 0, 0.5);
background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%,rgba(0,0,0,0) 100%), rgba(30, 100, 20, 0.9);
}
}
.btn-group {
display: inline-table;
.btn {
display: table-cell;
border-radius: 0;
border-right: none;
&:first-child {
border-radius: 5px 0 0 5px;
}
&:last-child {
border-radius: 0 5px 5px 0;
border-right: 1px solid black;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment