Css bg 2

In this example below you will see how to do a Css bg 2 with some HTML / CSS and Javascript

Original image by Tom Watson. Css version by me.Link in "JS"

Thumbnail
This awesome code was written by Thomasvd, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright Thomasvd ©

Technologies

  • HTML
  • CSS
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>Css bg 2</title>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js" type="text/javascript"></script>


    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">

  
      <style>
      /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */
      #bg {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 0;
  background: -webkit-linear-gradient(left, #feb5b3 0%, #feb5b3 2.86%, #dc8280 2.86%, #dc8280 5.72%, #fee0df 5.72%, #fee0df 8.58%, #ffcecd 8.58%, #ffcecd 11.14%, #c68381 11.14%, #c68381 14.3%, #ffd498 14.3%, #ffd498 17.16%, #ffe6c2 17.16%, #ffe6c2 20.02%, #ffdfb2 20.02%, #ffdfb2 22.88%, #ffca7f 22.88%, #ffca7f 25.74%, #f1c27f 25.74%, #f1c27f 28.6%, #fff498 28.6%, #fff498 31.46%, #fff9cb 31.46%, #fff9cb 34.32%, #fff6ae 34.32%, #fff6ae 37.18%, #fffce7 37.18%, #fffce7 40.04%, #fff17f 40.04%, #fff17f 42.9%, #a8ee81 42.9%, #a8ee81 45.76%, #dfffcd 45.76%, #dfffcd 48.62%, #98c67f 48.62%, #98c67f 51.48%, #eeffe5 51.48%, #eeffe5 54.34%, #c8f3b1 54.34%, #c8f3b1 57.2%, #7fb2eb 57.2%, #7fb2eb 60.06%, #badbff 60.06%, #badbff 62.92%, #7fa2c9 62.92%, #7fa2c9 65.78%, #e2ecf8 65.78%, #e2ecf8 68.64%, #a3cdfc 68.64%, #a3cdfc 71.5%, #b37fce 71.5%, #b37fce 74.36%, #f0d4ff 74.36%, #f0d4ff 77.22%, #dabce9 77.22%, #dabce9 80.08%, #f8ecff 80.08%, #f8ecff 82.94%, #f5e3ff 82.94%, #f5e3ff 85.8%, #cccccc 85.8%, #cccccc 88.66%, #a3a3a3 88.66%, #a3a3a3 91.52%, #b6b6b6 91.52%, #b6b6b6 94.38%, #cccccc 94.38%, #cccccc 97.24%, #ebebeb 97.24%, #ebebeb 100%);
}

    </style>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>

</head>

<body>

  <div id="bg"></div>
  <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>

  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/Thomasvd/css-bg-2-pobKz */
#bg {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 0;
  background: -webkit-linear-gradient(left, #feb5b3 0%, #feb5b3 2.86%, #dc8280 2.86%, #dc8280 5.72%, #fee0df 5.72%, #fee0df 8.58%, #ffcecd 8.58%, #ffcecd 11.14%, #c68381 11.14%, #c68381 14.3%, #ffd498 14.3%, #ffd498 17.16%, #ffe6c2 17.16%, #ffe6c2 20.02%, #ffdfb2 20.02%, #ffdfb2 22.88%, #ffca7f 22.88%, #ffca7f 25.74%, #f1c27f 25.74%, #f1c27f 28.6%, #fff498 28.6%, #fff498 31.46%, #fff9cb 31.46%, #fff9cb 34.32%, #fff6ae 34.32%, #fff6ae 37.18%, #fffce7 37.18%, #fffce7 40.04%, #fff17f 40.04%, #fff17f 42.9%, #a8ee81 42.9%, #a8ee81 45.76%, #dfffcd 45.76%, #dfffcd 48.62%, #98c67f 48.62%, #98c67f 51.48%, #eeffe5 51.48%, #eeffe5 54.34%, #c8f3b1 54.34%, #c8f3b1 57.2%, #7fb2eb 57.2%, #7fb2eb 60.06%, #badbff 60.06%, #badbff 62.92%, #7fa2c9 62.92%, #7fa2c9 65.78%, #e2ecf8 65.78%, #e2ecf8 68.64%, #a3cdfc 68.64%, #a3cdfc 71.5%, #b37fce 71.5%, #b37fce 74.36%, #f0d4ff 74.36%, #f0d4ff 77.22%, #dabce9 77.22%, #dabce9 80.08%, #f8ecff 80.08%, #f8ecff 82.94%, #f5e3ff 82.94%, #f5e3ff 85.8%, #cccccc 85.8%, #cccccc 88.66%, #a3a3a3 88.66%, #a3a3a3 91.52%, #b6b6b6 91.52%, #b6b6b6 94.38%, #cccccc 94.38%, #cccccc 97.24%, #ebebeb 97.24%, #ebebeb 100%);
}


/*Downloaded from https://www.codeseek.co/Thomasvd/css-bg-2-pobKz */
/*
	Yet another image from simpledesktops.

http://simpledesktops.com/browse/desktops/2009/nov/25/self-referential/

	Original image by Tom Watson
	Turned into css by Me (Mads Cordes)
*/

Comments