Question

I am trying to use css3 to create this shape:

simple shape

(I know the image quality is terrible but you get the point). I 've tried some of these css shape generators: http://medleyweb.com/resources/css-generator-ui-animation/ with no success. Any ideas?

Was it helpful?

Solution

Here's one way: http://codepen.io/anon/pen/HKbrq

HTML:

<div class="trapezoid">  </div>

CSS:

.trapezoid {
  width: 400px;
  height: 150px;
  border-style: solid;
  border-width: 40px;
  border-color: transparent;
  border-left-color: black;
  border-left-width: 300px;
}

OTHER TIPS

Have you tried with SVG ? you can draw polygons. SVG is XML-based. Or use the matrix() transform.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top