Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Scalable icons using background-sizing</title>
</head>
<body class="document" onload="zoomElm(document.getElementById('results'),slider.value)"">
<h1><a href="#">Scalable icons using <code>background-sizing</code></a></h1> 
<div class="overlay">
  <div id="toolbar">
<span>Scale:</span> <input id="slider" type="range" min="1" max="4" step="0.15" value="3" onchange="zoomElm(document.getElementById('results'),this.value)" >
</div>
</div>
<div id="container">
<section id="results">
    <span class="icon tick"></span>
</section>
</div>
  
  
  
</body>
</html>
 
/* Reset */
html {
  -webkit-font-smoothing: antialiased;
}
html, body {
  height: 100%;
}
body {
  margin: 0;
  padding: 0;
  line-height: 1;
}
.document {
  color: #999;
  font-family: "Helvetica", Arial, Helvetica, sans-serif;
  font-size: 22px;
}
.icon {
  background-size: 300%;
  width: 32px;
  height: 32px;
  display: inline-block;
  background-image: url(http://ux.globaldev.co.uk/box-sizing-test/icons/icons.png);
}
.icon.tick {
  background-position: 50% 100%;
}
h1 {
  font-size: 22px;
  font-weight: normal;
  padding: 24px;
  display: block;
  width: 100%;
  border-bottom: 2px solid #f5f5f5;
  text-align: center;
  margin: 0;
}
body a {
  text-decoration: none;
  color: #999;
  padding: 24px;
}
a:hover {
  color: #666;
}
.overlay {
  bottom: 0;
  left: 0;
  padding: 72px;
  position: fixed;
  width:100%;
  box-sizing: border-box; 
}
#toolbar {
    padding:22px 20px;
    background: #e5e5e5;
    color: #919191;
    font-size: 16px;
    
  overflow: hidden;
  border-radius: 3px;
  max-width: 600px;
  margin: 0 auto;
}
#toolbar span {
  width: 20%;
  display: block;
  float: left;
}
input {
  margin: 0;
  vertical-align: middle;
}
#container {
  height: 70%;
  margin: 0 auto;
  display: table;
}
#container:before {
  display: block;
  content: "";
  height: 100%;
  background: red;
  display: inline-block;
  vertical-align: middle;
}
#size {
  text-align: center;
  margin-bottom: 16px;
}
#results {
  display: inline-block;
  vertical-align: middle;
}
input {  
    -webkit-appearance: none;  
    background-color: #919191; 
  width: 80%;
  float: left;
  height: 4px;
  margin-top: 7px;
  box-sizing: border-box;
  border-radius: 2px;
}  
  
input::-webkit-slider-thumb { 
    -webkit-appearance: none;  
    border: 4px solid #919191; 
  background: #e5e5e5;
    width: 16px;  
    height: 16px; 
  border-radius: 10px;
}
code {
  font-family: Monaco, "Lucida Console", monospace;
border: 1px solid rgba(0,0,0,0.15);
-webkit-border-radius: 4px;
border-radius: 4px;
padding: 0 2px;
background: rgba(0,0,0,0.04);
  font-size: 21px;}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
sevenupcanpro
0viewers