CSS3 Shapes - What's possible? [closed]

与世无争的帅哥 提交于 2019-11-29 22:07:21

问题


I'm looking at only latest gen browsers:

  • IE9 (haven't really looked into this once much)
  • FF4
  • Chrome10
  • Safari5
  • iOS 3.4
  • Opera?

I know I can get squares and rectangles easy, circles and ellipsis with rounded borders (circles: W=H, ellipsis: W!=H). I know I can get slopes with border settings. I know how to get 1/2 and 1/4 circles, but is it possible to get:

  • Pie wedge (any size, at any location in the circle? ie. a 18% wedge, 20% off the horizontal)
  • Trapezoids, octagon, pentagon, hexagon
  • Stars (n pointed stars)
  • Any of the individual shapes in this that aren't already mentioned

I'm looking for CSS + DIV options, not <canvas> options. I'm also looking for options that use the least amount of nested divs. Here is an example that shows several shapes in one example...


回答1:


Check out this page for some examples: http://css-tricks.com/examples/ShapesOfCSS/. The examples use only a single HTML element, so more would be possible with added complexity.



来源:https://stackoverflow.com/questions/5560816/css3-shapes-whats-possible

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!