css3 - CSS Container Wrap shaped Polygons -


how can build white/green container (shaped polygons) css / css3 ?

enter image description here

you use basic svg path

http://codepen.io/anon/pen/xbaklp

<svg width="300px" height="100px" version="1.1" xmlns="http://www.w3.org/2000/svg">     <path d="m5 5 l170 3 l295 15 l280 95 l130 80 l110 95 l20 85" stroke="transparent" fill="#8eab32"></path> </svg> 
  • mx y represents first coordinates;
  • lx y represents straight line previous coordinates (x, y).

(you can find further information path on mdn)


result

enter image description here

then may add text or markup inside svg using <foreignobject>...</foreignobject> element, e.g. suppose need insert link

<svg width="300px" height="100px" version="1.1" xmlns="http://www.w3.org/2000/svg">     <path d="..."></path>      <foreignobject width="100%" height="100%">        <a href="#">noch 356 tage</a>         </foreignobject> </svg> 

along basic css

svg {   line-height: 100px;   text-align: center; }  svg {   color: #fff;   font: 36px "indie flower";   text-decoration: none; } 

the final result http://codepen.io/anon/pen/qbmeew


enter image description here

and can apply css transformation svg element itself, e.g.

svg {   transform: scale(.6) rotatez(-2deg); } 

so can in example.


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -