"gradient"
Bootstrap 3.0.0 Snippet by evarevirus

<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <!DOCTYPE html><html lang='en' class=''> <head><script src='//production-assets.codepen.io/assets/editor/live/console_runner-079c09a0e3b9ff743e39ee2d5637b9216b3545af0de366d4b9aad9dc87e26bfd.js'></script><script src='//production-assets.codepen.io/assets/editor/live/events_runner-73716630c22bbc8cff4bd0f07b135f00a0bdc5d14629260c3ec49e5606f98fdd.js'></script><script src='//production-assets.codepen.io/assets/editor/live/css_live_reload_init-2c0dc5167d60a5af3ee189d570b1835129687ea2a61bee3513dee3a50c115a77.js'></script><meta charset='UTF-8'><meta name="robots" content="noindex"><link rel="shortcut icon" type="image/x-icon" href="//production-assets.codepen.io/assets/favicon/favicon-8ea04875e70c4b0bb41da869e81236e54394d63638a1ef12fa558a4a835f1164.ico" /><link rel="mask-icon" type="" href="//production-assets.codepen.io/assets/favicon/logo-pin-f2d2b6d2c61838f7e76325261b7195c27224080bc099486ddd6dccb469b8e8e6.svg" color="#111" /><link rel="canonical" href="https://codepen.io/zachacole/pen/KdGzgb?limit=all&page=6&q=gradient" /> <style class="cp-pen-styles">html { background-image: linear-gradient(to bottom right, #E1BEE7, #B2EBF2); height: 150%; } h1, p, button { font-family: Helvetica, sans-serif; font-weight: 100; color: #fff; } h1 { letter-spacing: 0.5em; text-align: center; margin-top: 50px; line-height: 1.6em; } p { font-size: 1.1em; text-align: center; margin: 110px auto 20px; letter-spacing: 0.05em; } .container { text-align: center; position: relative; width: 300px; margin: 0 auto; cursor: pointer; } button { position: relative; height: 50px; width: 280px; border: 0; border-radius: 5px; text-transform: uppercase; font-size: 1.1em; letter-spacing: 0.2em; overflow: hidden; box-shadow: 0 4px 12px 0 rgba(152, 160, 180, 10); z-index: -2; } .button-one { } .fill-one { position: absolute; background-image: linear-gradient(to right, #E040FB, #00BCD4); height: 70px; width: 420px; border-radius: 5px; margin: -40px 0 0 -140px; z-index: -1; transition: all 0.4s ease; } .container-one:hover .fill-one { -webkit-transform: translateX(100px); -moz-transform: translateX(100px); transform: translateX(100px); } .fill-two { position: absolute; background-image: linear-gradient(to right, #E040FB, #00BCD4); background-size: 150% 150%; height: 70px; width: 420px; border-radius: 5px; margin: -40px 0 0 -140px; z-index: -1; transition: all 0.4s ease; } .container-two:hover .fill-two { -webkit-animation: gradient 3s ease infinite; -moz-animation: gradient 3s ease infinite; animation: gradient 3s ease infinite; } @-webkit-keyframes gradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } } @-moz-keyframes gradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } } @keyframes gradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }</style></head><body> <h1>BUTTON GRADIENT ANIMATIONS</h1> <p>gradient shift on hover</p> <div class="container container-one"> <button> Hover over me <div class="fill-one"></div> </button> </div> <p>infinite gradient shift on hover</p> <div class="container container-two"> <button> Hover over me <div class="fill-two"></div> </button> </div> </body></html>

Related: See More


Questions / Comments: