문제

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?

도움이 되었습니까?

해결책

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;
}

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top