内容简介:由张鑫旭大佬的几篇文章
由张鑫旭大佬的几篇文章
发现了border,border-radius, box-shadow一些特殊用法,由此想到自己做个总结。
border
只写一条边
.triangle { width: 100px; border-top: 100px solid red; }
同理可得其他边。
写border,同时只写一条边
top
.triangle { width: 100px; border: 100px solid black; border-top: 100px solid red; }
left
.triangle { width: 100px; border: 100px solid black; border-left: 100px solid red; }
写border,同时写两条边
.triangle { width: 100px; border: 100px solid black; border-top: 100px solid red; border-bottom: 100px solid blue; }
由此基本可以看出四条边的组成情况,在此基础上就可以做出各种变形。比如,文章中提到的 向下三角, 梯形等
boder-radius
应用一条边
top
.triangle { width: 100px; border: 100px solid black; border-top: 100px solid red; border-radius: 200px 0 0 0; }
.triangle { width: 50px; height: 50px; border-top: 10px solid red; border-radius: 200px 0 0 0; }
镂空
.triangle { width: 50px; height: 50px; border: 50px solid black; border-radius: 50px 0 0 0; }
应用两条边
.triangle { width: 50px; height: 50px; border-top: 10px solid red; border-left: 10px solid yellow; border-radius: 100px; }
应用四条边
圆环
.triangle { width: 50px; height: 50px; border-top: 10px solid red; border-radius: 100px; }
border-radius完整结构
border-radius: 1-4 length|% / 1-4 length|%;
“/” 前的四个数值表示圆角的水平半径,后面四个值表示圆角的垂直半径:
鹅蛋
.triangle { width: 50px; height: 50px; background: lightpink; border-bottom: 10px solid blue; border-left: 10px solid yellow; border-right: 10px solid black; border-top: 10px solid red; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; }
box-shadow
.triangle { width: 50px; height: 50px; background: lightpink; box-shadow: 50px 50px 0 0 purple; }
以上所述就是小编给大家介绍的《CSS图形绘制总结》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
计算机程序设计艺术(第3卷)-排序和查找(英文影印版)
(美)Donald E.Knuth / 清华大学出版社 / 2002-9 / 85.00元
《计算机程序设计艺术排序和查找(第3卷)(第2版)》内容简介:这是对第3卷的头一次修订,不仅是对经典计算机排序和查找技术的最全面介绍,而且还对第1卷中的数据结构处理技术作了进一步的扩充,通盘考虑了将大小型数据库和内外存储器。它遴选了一些经过反复检验的计算机方法,并对其效率做了定量分析。第3卷的突出特点是对“最优排序”一节作了修订,对排列论原理与通用散列法作了全新讨论。一起来看看 《计算机程序设计艺术(第3卷)-排序和查找(英文影印版)》 这本书的介绍吧!
RGB转16进制工具
RGB HEX 互转工具
URL 编码/解码
URL 编码/解码