创意无限:纯CSS打造各种形状钻石
网页因为 CSS 而呈现千变万化的风格。这一看似简单的样式语言在使用中非常灵活,只要你发挥创意就能实现很多比人想象不到的效果。特别是随着 CSS3 的广泛使用,更多新奇的 CSS 作品涌现出来。本文给大家带来 CSS 在网页中以及图形绘制中的使用。这篇文章给大家带来的是纯 CSS 绘制数学中的各种形状的砖石等。
关键词:HTML5、CSS
- #infinity {
- position: relative;
- width: 212px;
- height: 100px;
- }
-
- #infinity:before,
- #infinity:after {
- content: "";
- position: absolute;
- top: 0;
- left: 0;
- width: 60px;
- height: 60px;
- border: 20px solid red;
- -moz-border-radius: 50px 50px 0 50px;
- border-radius: 50px 50px 0 50px;
- -webkit-transform: rotate(-45deg);
- -moz-transform: rotate(-45deg);
- -ms-transform: rotate(-45deg);
- -o-transform: rotate(-45deg);
- transform: rotate(-45deg);
- }
-
- #infinity:after {
- left: auto;
- right: 0;
- -moz-border-radius: 50px 50px 50px 0;
- border-radius: 50px 50px 50px 0;
- -webkit-transform: rotate(45deg);
- -moz-transform: rotate(45deg);
- -ms-transform: rotate(45deg);
- -o-transform: rotate(45deg);
- transform: rotate(45deg);
- }
- #diamond {
- width: 0;
- height: 0;
- border: 50px solid transparent;
- border-bottom-color: red;
- position: relative;
- top: -50px;
- }
- #diamond:after {
- content: '';
- position: absolute;
- left: -50px;
- top: 50px;
- width: 0;
- height: 0;
- border: 50px solid transparent;
- border-top-color: red;
- }
- #diamond-shield {
- width: 0;
- height: 0;
- border: 50px solid transparent;
- border-bottom: 20px solid red;
- position: relative;
- top: -50px;
- }
- #diamond-shield:after {
- content: '';
- position: absolute;
- left: -50px; top: 20px;
- width: 0;
- height: 0;
- border: 50px solid transparent;
- border-top: 70px solid red;
- }
- #diamond-narrow {
- width: 0;
- height: 0;
- border: 50px solid transparent;
- border-bottom: 70px solid red;
- position: relative;
- top: -50px;
- }
- #diamond-narrow:after {
- content: '';
- position: absolute;
- left: -50px; top: 70px;
- width: 0;
- height: 0;
- border: 50px solid transparent;
- border-top: 70px solid red;
- }
- #cut-diamond {
- border-style: solid;
- border-color: transparent transparent red transparent;
- border-width: 0 25px 25px 25px;
- height: 0;
- width: 50px;
- position: relative;
- margin: 20px 0 50px 0;
- }
- #cut-diamond:after {
- content: "";
- position: absolute;
- top: 25px;
- left: -25px;
- width: 0;
- height: 0;
- border-style: solid;
- border-color: red transparent transparent transparent;
- border-width: 70px 50px 0 50px;
- }
关键词:HTML5、CSS
【创意无限:纯CSS打造各种形状钻石】相关文章
5. CSS 设置鼠标显示形状
9. 纯 CSS 绘制各种图形
10. Magic CSS3 – 创建各种神奇的交互动画效果
本文来源:https://www.51html5.com/a1002.html
上一篇:摇摆摇摆!动感的 CSS 抖动效果
下一篇:JS操作CSS随机改变网页背景
﹝创意无限:纯CSS打造各种形状钻石﹞相关内容
- 纯 CSS 绘制三角形(各种角度)
- CSS3创意动画列表项添加、删除效果
- CSDN范凯:云应用开发创意最重要
- Chrome实验网站:各种新奇事物让你爱不释手
- 2014年各种编程语言的薪资和市场需求
- 分享一个纯CSS开发的气泡式提示框
- 纯CSS实现的3D简洁按钮设计
- 纯css3有序列表
- [视频]纯CSS3腾讯QQ企鹅(附绘制过程)
- 用纯CSS3实现图片幻灯片切换效果