在这里您可以看到我正在尝试执行的操作: http://jsfiddle.net/ smogg/QFa4J/2/嵌入/结果/
我非常努力地试图实现这种外观,但现在这段代码可能真的很令人困惑。如果您有一些可以澄清这一点的提示,请告诉我。这一切都是通过反复试验而做出的。
无论如何,这看起来不错。唯一的问题是我在 .article
中的文本不可选择。 .article:before
内的边框会导致此问题。我该如何解决这个问题?或者也许我应该采取一些不同的步骤来实现这种外观(现在,使用我的解决方案,我必须定义文章的高度,这是有问题的)。
@编辑:
我忘了这件事了。我无法使用 z-index
因为我的 #main
上面有阴影(它没有包含在 jsFiddle 中以澄清代码),然后阴影显示在边框顶部。如果我使用没有 :before
的边框,那么我的 #main
会变宽,这不是我想要的。
Here you can see what I'm trying to do: http://jsfiddle.net/smogg/QFa4J/2/embedded/result/
I was trying to achieve this look so hard, and right now this code may be really confusing. If you have some tips which may clarify that, please tell me. It is all made by trial and error.
Anyway, this looks good. The only problem is my text inside .article
is not selectable. Borders inside .article:before
cause this problem. How can I solve this? Or maybe I should take some different steps to achieve this look (right now, with my solution I have to define height of articles which is problematic).
@edit:
I forgot about this. I can't use z-index
cause my #main
has shadow on it (which is not included in jsFiddle to clarify code) and then shadow shows on top of border. If I use borders without :before
then my #main
gets wider, which is not what I want.
发布评论
评论(1)
有更干净、更简单的方法可以做到这一点。享受!
http://www.css3d.net/ribbon-generator/
http://www.pvmgarage.com/2010/01/how-to-create-depth-and-nice-3d-ribbons-only-using-css3/
http://www.webresourcesdepot.com/creating-nice-3d-ribbons-with-pure-css3/
There are cleaner and easier ways to do this. Enjoy!
http://www.css3d.net/ribbon-generator/
http://www.pvmgarage.com/2010/01/how-to-create-depth-and-nice-3d-ribbons-only-using-css3/
http://www.webresourcesdepot.com/creating-nice-3d-ribbons-with-pure-css3/