Create an Angled Color Banner - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Banner

Description

Create an Angled Color Banner

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">

#container {<!--from w  w  w  .  j  a v  a2s  . co m-->
   width: 100%;
   height: 100px;
   background-color: white;
   position: absolute;
}
#blue {
   width: 200px;
   height: 100px;
   background-color: blue;
   float: left;
}
#purple {
   width: 100px;
   height: 100px;
   background-color: purple;
   float: left;
}
#triangle {
   width: 0;
   height: 0;
   border-left: 50px solid transparent;
   border-right: 50px solid transparent;
   border-bottom: 100px solid blue;
   float: left;
   margin-left: -50px;
}
#parallelogram {
   width: 50px;
   height: 100px;
   -webkit-transform: skew(30deg);
   -moz-transform: skew(30deg);
   -o-transform: skew(30deg);
   background: purple;
   float: left;
   margin-left: -50px;
}


      </style> 
 </head> 
 <body> 
  <div id="container"> 
   <div id="blue"></div> 
   <div id="triangle"></div> 
   <div id="parallelogram"></div> 
  </div>  
 </body>
</html>

Related Tutorials