Skip to content

Instantly share code, notes, and snippets.

@dellermann
Created August 12, 2013 14:24
Show Gist options
  • Save dellermann/6211255 to your computer and use it in GitHub Desktop.
Save dellermann/6211255 to your computer and use it in GitHub Desktop.
CSS linear gradients, simple and with color stops.
#foo {
background: #C5C5C5;
background: -ms-linear-gradient(
left, #F4F4F4 0, #F4F4F4 25px, #EEE 26px, #C5C5C5 43%, #C5C5C5 57%,
#EEE 974px, #F4F4F4 975px, #F4F4F4 100%
);
background: -moz-linear-gradient(
left, #F4F4F4 0, #F4F4F4 25px, #EEE 26px, #C5C5C5 43%, #C5C5C5 57%,
#EEE 974px, #F4F4F4 975px, #F4F4F4 100%
);
background: -o-linear-gradient(
left, #F4F4F4 0, #F4F4F4 25px, #EEE 26px, #C5C5C5 43%, #C5C5C5 57%,
#EEE 974px, #F4F4F4 975px, #F4F4F4 100%
);
background: -webkit-gradient(
linear, left top, right top, from(#F4F4F4), color-stop(25px, #F4F4F4),
color-stop(26px, #EEE), color-stop(43%, #C5C5C5),
color-stop(57%, #C5C5C5), color-stop(974px, #EEE),
color-stop(975px, #F4F4F4), to(#F4F4F4)
);
background: -webkit-linear-gradient(
left, #F4F4F4 0, #F4F4F4 25px, #EEE 26px, #C5C5C5 43%, #C5C5C5 57%,
#EEE 974px, #F4F4F4 975px, #F4F4F4 100%
);
background: linear-gradient(
left, #F4F4F4 0, #F4F4F4 25px, #EEE 26px, #C5C5C5 43%, #C5C5C5 57%,
#EEE 974px, #F4F4F4 975px, #F4F4F4 100%
);
}
#main-menu {
background: #97b42d;
background: -khtml-gradient(
linear, left top, left bottom, from(#b0c639), to(#80a322)
);
background: -ms-linear-gradient(top, #b0c639, #80a322);
background: -moz-linear-gradient(top, #b0c639, #80a322);
background: -o-linear-gradient(top, #b0c639, #80a322);
background: -webkit-gradient(
linear, left top, left bottom, from(#b0c639), to(#80a322)
);
background: -webkit-linear-gradient(top, #b0c639, #80a322);
background: linear-gradient(top, #b0c639, #80a322);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment