Created
November 4, 2012 20:21
-
-
Save apphp-snippets/4013533 to your computer and use it in GitHub Desktop.
Today with CSS3, you no longer need a background image for gradients. You can use CSS to add a gradient to the background of some elements on your page. For ex.: change the color hex values ("84c8d7" and "327fbd") to the gradient color you need.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <style> | |
| /* Source: http://www.apphp.com/index.php?snippet=css-background-gradient */ | |
| .grad{ | |
| background: -webkit-gradient(linear, left top, left bottom, from(#84c8d7), to(#327fbd)); | |
| background: -moz-linear-gradient(top, #84c8d7, #327fbd); | |
| filter: | |
| progid:DXImageTransform.Microsoft.gradient(startColorstr="#84c8d7", endColorstr="#327fbd"); | |
| } | |
| </style> | |
| <div class="grad">This is a DIV with gradient background.</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment