平角锐角或斜角 [英] Flat sharp corner or beveled corners

查看:267
本文介绍了平角锐角或斜角的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以用CSS和HTML创建一个尖锐的平角?

Is there any way to create a sharp flat corner with CSS and HTML?

这样的东西:

  ____
 /    \
 |    |
 \____/


推荐答案

解决方案,使用Chris Coyier的CSS形状。

Here is my solution, using the CSS shapes from Chris Coyier.

http:// jsfiddle。 net / dDejan / XSs9L /

通过JavaScript(实际上是jQuery)为你想要形成的每个容器插入4个额外的div。这些div绝对位于它的父节点的角落,并且它们的样式相应地如Sven Bieder发布的链接中所述

4 extra divs are inserted via JavaScript (well, jQuery actually) for each of your containers that you want shaped this way. These divs are positioned absolutely in the corners of it's parent, and they are styled accordingly as described in the link posted by Sven Bieder

这篇关于平角锐角或斜角的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆