Skip to content

Instantly share code, notes, and snippets.

@mattslack
Created September 13, 2011 15:38
Show Gist options
  • Save mattslack/1214139 to your computer and use it in GitHub Desktop.
Save mattslack/1214139 to your computer and use it in GitHub Desktop.
Color Selector
<style>
.spectrum {
display: block;
width: 150px;
height: 15px;
margin-left: 2px;
background: -webkit-linear-gradient(left, hsl(0,100%,50%),hsl(60,100%, 50%), hsl(120,100%, 50%), hsl(180, 100%, 50%), hsl(240,100%,50%), hsl(300,100%,50%) 100%),
-moz-linear-gradient(left, hsl(0,100%,50%),hsl(60,100%, 50%), hsl(120,100%, 50%), hsl(180, 100%, 50%), hsl(240,100%,50%), hsl(300,100%,50%) 100%)
-o-linear-gradient(left, hsl(0,100%,50%),hsl(60,100%, 50%), hsl(120,100%, 50%), hsl(180, 100%, 50%), hsl(240,100%,50%), hsl(300,100%,50%) 100%);
}
input[type=range] {
width: 150px;
margin-top: -5px;
}
</style>
<span class="spectrum"></span>
<input type="range" min="0" max="300" step="1">
@danielmorrison
Copy link

er, the other way 'round.

@mattslack
Copy link
Author

Because the value attribute must be specified, and that makes the solution much less simple.

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