一侧成角度的背景正方形 [英] background square with one side at an angle
本文介绍了一侧成角度的背景正方形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望能够仅使用CSS来创建透明背景,但一端要有一个角度.我找到了尝试执行此操作的各种方法,但还不太了解.我真的不想使用任何脚本,只是CSS.
I want to be able to create a transparent background using only CSS but with an angle on one end. I've found various ways of trying to do it, but can't quite get it. I don't really want to use any scripting, just CSS.
背景图片应如下所示:
推荐答案
您可以使用边框: http://jsfiddle.net/wNhjb/
#shape {
height: 0;
width: 80px;
border-top: 80px solid blue;
border-left: 40px solid transparent;
}
这篇关于一侧成角度的背景正方形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文