Codesnipp.it Social Code Sharing

Luiz Gustavo Assuena

Background gradient with Less variables

by Luiz Gustavo Assuena on Jun 03, 2011

.gradient-tb(@top, @bottom){ background: @top; /* Old browsers */ background: -moz-linear-gradient(top, @top 10%, @bottom 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(10%,@top,), color-stop(100%,@bottom)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, @top, 10%,@bottom 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, @top, 10%,@bottom 100%); /* Opera11.10+ */ background: -ms-linear-gradient(top, @top 10%,@bottom 100%); /* IE10+ */ filter: ~"progid:DXImageTransform.Microsoft.gradient( startColorstr='@top', endColorstr='@bottom',GradientType=0 )"; /* IE6-9 */ background: linear-gradient(top, @top 10%,@bottom 100%); /* W3C */ }

Can't see the comments? Please login first :)