html - drawing shapes with css -
am trying shape drawn in css on header of webpage. supposed this. the shape trying draw header
but when try exact shape, looks below (run snippet)
am not @ css struggling here. codes below.
header { padding: 0px !important; height: auto !important; } .header { top: 0px; width: 100%; height: auto !important; padding: 0px !important; background-color: #00ff00; } .spanheader { font-size: 20px; } .logo { z-index: 1; position: relative; } .topheader { text-align: center; width: 100%; background-color: lightgray; left: 0px !important; top: 0px !important; } #draw { height: 30px; width: 100%; background-color: #fff; } #green { height: 60px; width: 100%; border-width: 0px; border-left: 280px solid white; border-top: 20px solid white; -moz-transform: skew(-45deg); -webkit-transform: skew(-45deg); transform: skew(-45deg); }
<section id="header" class="header"> <div class="topheader"> <span class="spanheader f-700 c-gray">header</span> </div> <div id="draw"></div> <div id="green"></div> </section>
what trying achieve header , shape drawing
you can create small white rectangle @ left top, skew , move little left remove green triangle:
.green { background-color:#0f0; height:60px; width:100%; } .draw { height:30px; margin-left:-15%; width:30%; background-color:#fff; -moz-transform: skew(-45deg); -webkit-transform: skew(-45deg); transform: skew(-45deg); }
<div class="green"> <div class="draw"> </div> </div>
Comments
Post a Comment