Skip to content

Instantly share code, notes, and snippets.

@yukulele
Created March 5, 2013 09:08
Show Gist options
  • Save yukulele/5088958 to your computer and use it in GitHub Desktop.
Save yukulele/5088958 to your computer and use it in GitHub Desktop.
rgba with 0 alpha component
/**
* rgba with 0 alpha component
*/
ul>li{
height:30px;
line-height:30px;
border:1px dotted grey;
margin:10px;
font-family:sans-serif;
}
ul>li:nth-child(1){
background-image:linear-gradient(90deg,rgba(0,255,0,1) 0,rgba(0,255,0,0) 100%);
}
ul>li:nth-child(2){
background-image:linear-gradient(90deg,rgba(0,255,0,1) 0,rgba(255,0,0,0) 100%);
}
ul>li:nth-child(3){
background-image:linear-gradient(90deg,rgba(0,255,0,1) 0,rgba(0,0,0,0) 100%);
}
ul>li:nth-child(4){
background-image:linear-gradient(90deg,rgba(0,255,0,1) 0,transparent 100%);
}
<ul>
<li>rgba(0,255,0,1) &rarr; rgba(0,255,0,0)</li>
<li>rgba(0,255,0,1) &rarr; rgba(255,0,0,0)</li>
<li>rgba(0,255,0,1) &rarr; rgba(0,0,0,0)</li>
<li>rgba(0,255,0,1) &rarr; transparent</li>
</ul>
// alert('Hello world!');
{"view":"separate","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment