Over a million developers have joined DZone.

Cross Browser CSS Gradients With Sass

DZone's Guide to

Cross Browser CSS Gradients With Sass

· ·
Free Resource
@mixin gradient($first, $second) {
  background: $second;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='$first', endColorstr='$second');
  background: -webkit-gradient(linear, left top, left bottom, from($first), to($second));
  background: -moz-linear-gradient(top,  $first,  $second);

.gradient {
  @include gradient(black, white);

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}