Skip to content

Instantly share code, notes, and snippets.

@rdmurphy
Forked from anonymous/jsbin.ILOcAGO.css
Created November 21, 2013 23:56
Show Gist options
  • Save rdmurphy/7592175 to your computer and use it in GitHub Desktop.
Save rdmurphy/7592175 to your computer and use it in GitHub Desktop.
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body {
background-color: black;
}
.legend {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
z-index: 1002;
background-color: rgb(255,255,255);
background-color: rgba(255,255,255,0.95);
color: rgb(34, 34, 34);
padding: 10px;
width: 300px;
height: 75px;
}
.legend .legend-title {
text-align: left;
margin-bottom: 8px;
font-weight: bold;
font-size: 14px;
line-height: 1.3em;
}
.legend ul {
margin: 0;
padding: 0;
float: left;
list-style: none;
width: 100%;
height: 30px;
}
.legend ul li {
float: left;
position: relative;
height: 15px;
width: 16.6%;
list-style: none;
border-right: 1px solid rgb(51, 51, 51);
}
.legend ul li:last-child {
border-right: none;
}
.legend li div {
position: relative;
height: 10px;
width: 100%;
}
.legend li p {
position: absolute;
font-size: 12px;
font-weight: bold;
text-align: center;
width: 100%;
margin: 0;
top: 15px;
left: -25px;
}
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<div class='legend'>
<div class='legend-title'>Difference in Median Home Value</div>
<ul class='legend-labels'>
<li>
<div style='background-color:rgb(255, 255, 204);'></div>
</li>
<li>
<div style='background-color:rgb(199, 233, 180);'></div>
<p>$500</p>
</li>
<li>
<div style='background-color:rgb(127, 205, 187);'></div>
<p>$1,000</p>
</li>
<li>
<div style='background-color:rgb(65, 182, 196);'></div>
<p>$1,500</p>
</li>
<li>
<div style='background-color:rgb(44, 127, 184);'></div>
<p>$2,000</p>
</li>
<li>
<div style='background-color:rgb(37, 52, 148);'></div>
<p>$2,500</p>
</li>
</ul>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment