Diagonal background effect with gradient color - HTML CSS CSS Property

HTML CSS examples for CSS Property:background-color

Description

Diagonal background effect with gradient color

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">

body {<!--from  w w  w  .j a va  2s  . co  m-->
   height: 100vh;
   width: 100vw;
   padding: 0;
   margin: 0;
   position: relative;
   background: #ff3236;
   background: -moz-linear-gradient(left, #ff3236 0%, #0011ff 100%);
   background: -webkit-linear-gradient(left, #ff3236 0%, #0011ff 100%);
   background: linear-gradient(to right, #ff3236 0%, #0011ff 100%);
   filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ff3236', endColorstr='#0011ff',GradientType=1); }
   body:before {
      content: '';
      display: block;
      width: 0;
      height: 0;
      border-style: solid;
      border-width: 0 0 100vh 100vw;
      border-color: transparent transparent #fff transparent;
      z-index: 2; }


      </style> 
 </head> 
 <body>  
 </body>
</html>

Related Tutorials