0

0

css3绘制中国结_html/css_WEB-ITnose

php中文网

php中文网

发布时间:2016-06-24 11:39:17

|

1661人浏览过

|

来源于php中文网

原创

  1 <!doctype html>  2 <html>  3     <head>  4         <title></title>  5         <meta charset='utf-8'>  6         <style type="text/css">  7         :root,body{  8             height: 100%;  9             width: 100%; 10         } 11         .z{ 12             width:200px; 13             height: 400px; 14             left: 400px; 15             position: absolute; 16         } 17         .z div{ 18             position: absolute; 19              20         } 21         .z .red{ 22             background-color: red; 23             box-shadow: 0px 0px 1px 0 #666; 24         } 25         .f1{ 26             width: 18px; 27             height: 18px; 28             -webkit-transform: rotate(45deg); 29                -moz-transform: rotate(45deg); 30                 -ms-transform: rotate(45deg); 31                  -o-transform: rotate(45deg); 32                     transform: rotate(45deg); 33             top:0; 34             border-radius: 2px; 35         } 36         .l1,.l2,.l3,.l4{ 37             width:2px; 38             height: 10px; 39         } 40         .c1{ 41             width:14px; 42             height: 14px; 43             border-radius: 7px; 44             box-shadow: 0px 0px 1px 0 #666; 45             z-index: 10; 46         } 47         .c1-1 { 48             position: relative; 49             width: 40px; 50             height: 12px; 51         } 52         .c1-1:before, 53         .c1-1:after { 54             box-shadow: 0px 0px 1px 0 #666; 55             content: ""; 56             position: absolute; 57             top: 0; 58             left: 0; 59             width: 8px; 60             height: 14px;     61             border: 2px solid red; 62             border-radius:50%   50%  50%  50%  / 30%   30%   70%  70%; 63             -webkit-transform: rotate(-90deg); 64                -moz-transform: rotate(-90deg); 65                 -ms-transform: rotate(-90deg); 66                  -o-transform: rotate(-90deg); 67                     transform: rotate(-90deg); 68         } 69           70         .c1-1:after { 71             left: auto; 72             right: 0; 73             border-radius:50%   50%  50%  50%  / 70%   70%   30%  30%; 74             -webkit-transform: rotate(-90deg); 75                -moz-transform: rotate(-90deg); 76                 -ms-transform: rotate(-90deg); 77                  -o-transform: rotate(-90deg); 78                     transform: rotate(-90deg); 79         } 80         .r{ 81             width:80px; 82             height: 80px; 83             z-index: 10; 84             -webkit-transform: rotate(45deg); 85                -moz-transform: rotate(45deg); 86                 -ms-transform: rotate(45deg); 87                  -o-transform: rotate(45deg); 88                     transform: rotate(45deg); 89         } 90         .r .ro{ 91             position: relative; 92             display: table; 93             border-collapse:separate; 94              border-spacing: 1px; 95         } 96         .r .b{ 97             width:15px; 98             height: 14px; 99             position: relative;100             display: table-cell;101             border-radius: 2px;102         }103         .c2{104             width:10px;105             height: 10px;106             border-radius: 5px;107         }108         .c3{109             width:10px;110             height: 10px;111             border-radius: 5px 5px 0 0;112         }113         .c4{114             width:14px;115             height: 14px;116             border-radius: 8px;117             z-index: 10;118         }119         .k{120             width: 10px;121             height: 12px;122         }123         .k1{124124             width: 14px;125             height: 6px;126         }127         .s{128             height: 150px;129             display: table;130             border-collapse:separate;131              border-spacing: 1px;132         }133         .ss{134             width: 1px;135             height: 100%;136             position: relative !important;137             display: table-cell;138         }139         .i1 {140             position: relative;141             width: 162px;142             height: 46px;143         }144          145         .i1:before,146         .i1:after {147             box-shadow: 0px 0px 1px 0 #666;148             content: "";149             position: absolute;150             top: 0;151             left: 0;152             width: 30px;153             height: 40px;    154             border: 3px solid red;155                border-radius:50%   50%  50%  50%  / 30%   30%   70%  70%;156             -webkit-transform: rotate(-90deg);157                -moz-transform: rotate(-90deg);158                 -ms-transform: rotate(-90deg);159                  -o-transform: rotate(-90deg);160                     transform: rotate(-90deg);161         }162          163         .i1:after,.i2:after {164             left: auto;165             right: 0;166             border-radius:50%   50%  50%  50%  / 70%   70%   30%  30%;167             -webkit-transform: rotate(-90deg);168                -moz-transform: rotate(-90deg);169                 -ms-transform: rotate(-90deg);170                  -o-transform: rotate(-90deg);171                     transform: rotate(-90deg);172         } 173         .i2 {174             position: relative;175             width: 136px;176             height: 24px;177         }178         .i2:before,179         .i2:after {180             box-shadow: 0px 0px 1px 0 #666;181             content: "";182             position: absolute;183             top: 0;184             left: 0;185             width: 12px;186             height: 20px;    187             border: 2px solid red;188             border-radius:50%   50%  50%  50%  / 30%   30%   70%  70%;189             -webkit-transform: rotate(-90deg);190                -moz-transform: rotate(-90deg);191                 -ms-transform: rotate(-90deg);192                  -o-transform: rotate(-90deg);193                     transform: rotate(-90deg);194         }195          196         .i2:after {197             left: auto;198             right: 0;199             border-radius:50%   50%  50%  50%  / 70%   70%   30%  30%;200             -webkit-transform: rotate(-90deg);201                -moz-transform: rotate(-90deg);202                 -ms-transform: rotate(-90deg);203                  -o-transform: rotate(-90deg);204                     transform: rotate(-90deg);205         }  206         .e1 {207             position: relative;208             width: 12px;209             height: 24px;210         }211         .e1:before,212         .e1:after {213             box-shadow: 0px 0px 1px 0 #666;214             content: "";215             position: absolute;216             top: 0;217             left: 0;218             width: 12px;219             height: 20px;    220             border: 2px solid red;221             border-radius:50%   50%  50%  50%  / 30%   30%   70%  70%;222             -webkit-transform: rotate(-90deg);223                -moz-transform: rotate(-90deg);224                 -ms-transform: rotate(-90deg);225                  -o-transform: rotate(-90deg);226                     transform: rotate(-90deg);227         }228         .m{229             width:80px;230             height: 80px;231             -webkit-transform: rotate(45deg);232                -moz-transform: rotate(45deg);233                 -ms-transform: rotate(45deg);234                  -o-transform: rotate(45deg);235                     transform: rotate(45deg);236 237         }238         .n{239             width:80px;240             height: 80px;241             -webkit-transform: rotate(-45deg);242                -moz-transform: rotate(-45deg);243                 -ms-transform: rotate(-45deg);244                  -o-transform: rotate(-45deg);245                     transform: rotate(-45deg);246 247         }248         .m .rx,.n .rx{249             position: relative;250             display: table;251             border-collapse:separate;252              border-spacing: 1px;253         }254         .m .rb , .m .rb-space,.n .rb , .n .rb-space{255             position: relative;256              width: 120px;257             height: 14px;258             display: table-cell;259         }260          261         .m .rb:before,262         .m .rb:after,.n .rb:before,263         .n .rb:after {264             box-shadow: 0px 0px 1px 0 #666;265             content: "";266             position: absolute;267             top: 0;268             left: -8px;269             width: 6px;270             height: 10px;    271             border: 2px solid red;272                border-radius:50%   50%  50%  50%  / 40%   40%   60%  60%;273             -webkit-transform: rotate(-90deg);274                -moz-transform: rotate(-90deg);275                 -ms-transform: rotate(-90deg);276                  -o-transform: rotate(-90deg);277                     transform: rotate(-90deg);278         }279          280         .m .rb:after,.n .rb:after{281             left: auto;282             right: -8px;283             border-radius:50%   50%  50%  50%  / 60%   60%   60%  60%;284             -webkit-transform: rotate(-90deg);285                -moz-transform: rotate(-90deg);286                 -ms-transform: rotate(-90deg);287                  -o-transform: rotate(-90deg);288                     transform: rotate(-90deg);289         } 290         </style>291         <script type="text/javascript" src='../bower_components/jquery/dist/jquery.js'></script>292         <script type="text/javascript">293         $(document).ready(function(){294             var $z  = $('.z'), $f1 = $('.f1') , $l1 = $('.l1') , $c1 = $('.c1') , $l2 = $('.l2') , $r = $('.r') , $l3 = $('.l3') , $c2 = $('.c2') , $l4 = $('.l4') , $c3 = $('.c3') , $c4 = $('.c4'),295                 $k = $('.k') , $k1 = $('.k1') , $s = $('.s') , $i1 = $('.i1') , $i2 = $('.i2'),296                 $e1 = $('.e1') , $c1_1 = $('.c1-1'),297                 $m = $('.m') , $n = $('.n');298             $f1.css({299                 left : ($z.width()  - $f1.width()) / 2 , 300                 top : Math.sqrt(2 * Math.pow($f1.height() / 2 , 2)) - $f1.height() / 2301             });302             $l1.css({303                 left : ($z.width()  - $l1.width()) / 2,304                 top : Math.sqrt(2 * Math.pow($f1.height() , 2))305             });306             $c1.css({307                 left : ($z.width()  - $c1.width()) / 2,308                 top : Math.sqrt(2 * Math.pow($f1.height() , 2)) + $l1.height()309             });310             $l2.css({311                 left : ($z.width()  - $l2.width()) / 2,312                 top : Math.sqrt(2 * Math.pow($f1.height() , 2)) + $l1.height() + $c1.height()313             });314             $r.css({315                 left : ($z.width()  - $r.width()) / 2,316                 top : Math.sqrt(2 * Math.pow($f1.height() , 2)) + $l1.height() + $c1.height() + $l2.height() + Math.sqrt(2 * Math.pow($r.height() / 2 , 2)) - $r.height() / 2317             });318             $l3.css({319                 left : ($z.width()  - $l3.width()) / 2,320                 top : Math.sqrt(2 * Math.pow($f1.height() , 2)) + $l1.height() + $c1.height() + $l2.height() + Math.sqrt(2 * Math.pow($r.height() , 2))321             });322             $c2.css({323                 left : ($z.width()  - $c2.width()) / 2,324                 top : Math.sqrt(2 * Math.pow($f1.height() , 2)) + $l1.height() + $c1.height() + $l2.height() + Math.sqrt(2 * Math.pow($r.height() , 2)) + $l3.height()325             });326             $l4.css({327                 left : ($z.width()  - $l4.width()) / 2,328                 top : Math.sqrt(2 * Math.pow($f1.height() , 2)) + $l1.height() + $c1.height() + $l2.height() + Math.sqrt(2 * Math.pow($r.height() , 2)) + $l3.height() + $c2.height()329             });330             $c3.css({331                 left : ($z.width()  - $c3.width()) / 2,332                 top : Math.sqrt(2 * Math.pow($f1.height() , 2)) + $l1.height() + $c1.height() + $l2.height() + Math.sqrt(2 * Math.pow($r.height() , 2)) + $l3.height() + $c2.height() + $l4.height()333             });334             $c4.css({335                 left : ($z.width()  - $c4.width()) / 2,336                 top : Math.sqrt(2 * Math.pow($f1.height() , 2)) + $l1.height() + $c1.height() + $l2.height() + Math.sqrt(2 * Math.pow($r.height() , 2)) + $l3.height() + $c2.height() + $l4.height() + $c3.height() - 4337             });338             $k.css({339                 left : ($z.width()  - $k.width()) / 2,340                 top : Math.sqrt(2 * Math.pow($f1.height() , 2)) + $l1.height() + $c1.height() + $l2.height() + Math.sqrt(2 * Math.pow($r.height() , 2)) + $l3.height() + $c2.height() + $l4.height() + $c3.height() - 4 +  $c4.height() - 4341             });342             $k1.css({343                 left : ($z.width()  - $k1.width()) / 2,344                 top : Math.sqrt(2 * Math.pow($f1.height() , 2)) + $l1.height() + $c1.height() + $l2.height() + Math.sqrt(2 * Math.pow($r.height() , 2)) + $l3.height() + $c2.height() + $l4.height() + $c3.height() - 4 +  $c4.height() - 4 + $k.height()345             });346             $s.css({347                 left : ($z.width()  - $k1.width()) / 2,348                 top : Math.sqrt(2 * Math.pow($f1.height() , 2)) + $l1.height() + $c1.height() + $l2.height() + Math.sqrt(2 * Math.pow($r.height() , 2)) + $l3.height() + $c2.height() + $l4.height() + $c3.height() - 4 +  $c4.height() - 4 + $k.height() + $k1.height()349             });350 351             $i1.css({352                 left : ($z.width()  - $i1.width()) / 2,353                 top : Math.sqrt(2 * Math.pow($f1.height() , 2)) + $l1.height() + $c1.height() + $l2.height() + Math.sqrt(2 * Math.pow($r.height() , 2)) / 2 - $i1.height() / 2354             });355             $i2.css({356                 left : ($z.width()  - $i2.width()) / 2,357                 top : Math.sqrt(2 * Math.pow($f1.height() , 2)) + $l1.height() + $c1.height() + $l2.height() + Math.sqrt(2 * Math.pow($r.height() , 2)) / 2 - $i2.height() / 2358             });359             $c1_1.css({360                 left : ($z.width()  - $c1_1.width()) / 2,361                 top : Math.sqrt(2 * Math.pow($f1.height() , 2)) + $l1.height() + ($c1_1.height() - $c1.height()) / 2362             });363             $m.css({364                 left : ($z.width()  - $m.width()) / 2,365                 top : Math.sqrt(2 * Math.pow($f1.height() , 2)) + $l1.height() + $c1.height() + $l2.height() + Math.sqrt(2 * Math.pow($m.height() / 2 , 2)) - $m.height() / 2366             });367             $n.css({368                 left : ($z.width()  - $n.width()) / 2,369                 top : Math.sqrt(2 * Math.pow($f1.height() , 2)) + $l1.height() + $c1.height() + $l2.height() + Math.sqrt(2 * Math.pow($n.height() / 2 , 2)) - $n.height() / 2370             });371         });372         </script>373     </head>374     <body>375         <div class='z'>376             <div class='f1 red'></div>377             <div class='l1 red'></div>378             <div class='c1 red'></div>379             <div class='c1-1'></div>380             <div class='l2 red'></div>381             <div class='r'>382                 <div class='ro'>383                     <div class='b red'></div>384                     <div class='b red'></div>385                     <div class='b red'></div>386                     <div class='b red'></div>387                     <div class='b red'></div>388                 </div>389                 <div class='ro'>390                     <div class='b red'></div>391                     <div class='b red'></div>392                     <div class='b red'></div>393                     <div class='b red'></div>394                     <div class='b red'></div>395                 </div>396                 <div class='ro'>397                     <div class='b red'></div>398                     <div class='b red'></div>399                     <div class='b red'></div>400                     <div class='b red'></div>401                     <div class='b red'></div>402                 </div>403                 <div class='ro'>404                     <div class='b red'></div>405                     <div class='b red'></div>406                     <div class='b red'></div>407                     <div class='b red'></div>408                     <div class='b red'></div>409                 </div>410                 <div class='ro'>411                     <div class='b red'></div>412                     <div class='b red'></div>413                     <div class='b red'></div>414                     <div class='b red'></div>415                     <div class='b red'></div>416                 </div>417             </div>418             <div class='l3 red'></div>419             <div class='c2 red'></div>420             <div class='l4 red'></div>421             <div class='c3 red'></div>422             <div class='c4 red'></div>423             <div class='k red'></div>424             <div class='k1 red'></div>425             <div class='s'>426                 <div class='ss red'></div>427                 <div class='ss red'></div>428                 <div class='ss red'></div>429                 <div class='ss red'></div>430                 <div class='ss red'></div>431                 <div class='ss red'></div>432                 <div class='ss red'></div>433             </div>434             <div class='i1'></div>435             <div class='i2'></div>436             <div class='m'>437                 <div class='rx'>438                     <div class='rb-space'></div>439                 </div>440                 <div class='rx'>441                     <div class='rb'></div>442                 </div>443                 <div class='rx'>444                     <div class='rb'></div>445                 </div>446                 <div class='rx'>447                     <div class='rb'></div>448                 </div>449                 <div class='rx'>450                     <div class='rb-space'></div>451                 </div>452             </div>453             <div class='n'>454                 <div class='rx'>455                     <div class='rb-space'></div>456                 </div>457                 <div class='rx'>458                     <div class='rb'></div>459                 </div>460                 <div class='rx'>461                     <div class='rb'></div>462                 </div>463                 <div class='rx'>464                     <div class='rb'></div>465                 </div>466                 <div class='rx'>467                     <div class='rb-space'></div>468                 </div>469             </div>470         </div>471     </body>472 </html>

Favird No-Code Tools
Favird No-Code Tools

无代码工具的聚合器

下载

热门AI工具

更多
DeepSeek
DeepSeek

幻方量化公司旗下的开源大模型平台

豆包大模型
豆包大模型

字节跳动自主研发的一系列大型语言模型

通义千问
通义千问

阿里巴巴推出的全能AI助手

腾讯元宝
腾讯元宝

腾讯混元平台推出的AI助手

文心一言
文心一言

文心一言是百度开发的AI聊天机器人,通过对话可以生成各种形式的内容。

讯飞写作
讯飞写作

基于讯飞星火大模型的AI写作工具,可以快速生成新闻稿件、品宣文案、工作总结、心得体会等各种文文稿

即梦AI
即梦AI

一站式AI创作平台,免费AI图片和视频生成。

ChatGPT
ChatGPT

最最强大的AI聊天机器人程序,ChatGPT不单是聊天机器人,还能进行撰写邮件、视频脚本、文案、翻译、代码等任务。

相关专题

更多
Golang 测试体系与代码质量保障:工程级可靠性建设
Golang 测试体系与代码质量保障:工程级可靠性建设

Go语言测试体系与代码质量保障聚焦于构建工程级可靠性系统。本专题深入解析Go的测试工具链(如go test)、单元测试、集成测试及端到端测试实践,结合代码覆盖率分析、静态代码扫描(如go vet)和动态分析工具,建立全链路质量监控机制。通过自动化测试框架、持续集成(CI)流水线配置及代码审查规范,实现测试用例管理、缺陷追踪与质量门禁控制,确保代码健壮性与可维护性,为高可靠性工程系统提供质量保障。

46

2026.02.28

Golang 工程化架构设计:可维护与可演进系统构建
Golang 工程化架构设计:可维护与可演进系统构建

Go语言工程化架构设计专注于构建高可维护性、可演进的企业级系统。本专题深入探讨Go项目的目录结构设计、模块划分、依赖管理等核心架构原则,涵盖微服务架构、领域驱动设计(DDD)在Go中的实践应用。通过实战案例解析接口抽象、错误处理、配置管理、日志监控等关键工程化技术,帮助开发者掌握构建稳定、可扩展Go应用的最佳实践方法。

41

2026.02.28

Golang 性能分析与运行时机制:构建高性能程序
Golang 性能分析与运行时机制:构建高性能程序

Go语言以其高效的并发模型和优异的性能表现广泛应用于高并发、高性能场景。其运行时机制包括 Goroutine 调度、内存管理、垃圾回收等方面,深入理解这些机制有助于编写更高效稳定的程序。本专题将系统讲解 Golang 的性能分析工具使用、常见性能瓶颈定位及优化策略,并结合实际案例剖析 Go 程序的运行时行为,帮助开发者掌握构建高性能应用的关键技能。

37

2026.02.28

Golang 并发编程模型与工程实践:从语言特性到系统性能
Golang 并发编程模型与工程实践:从语言特性到系统性能

本专题系统讲解 Golang 并发编程模型,从语言级特性出发,深入理解 goroutine、channel 与调度机制。结合工程实践,分析并发设计模式、性能瓶颈与资源控制策略,帮助将并发能力有效转化为稳定、可扩展的系统性能优势。

21

2026.02.27

Golang 高级特性与最佳实践:提升代码艺术
Golang 高级特性与最佳实践:提升代码艺术

本专题深入剖析 Golang 的高级特性与工程级最佳实践,涵盖并发模型、内存管理、接口设计与错误处理策略。通过真实场景与代码对比,引导从“可运行”走向“高质量”,帮助构建高性能、可扩展、易维护的优雅 Go 代码体系。

18

2026.02.27

Golang 测试与调试专题:确保代码可靠性
Golang 测试与调试专题:确保代码可靠性

本专题聚焦 Golang 的测试与调试体系,系统讲解单元测试、表驱动测试、基准测试与覆盖率分析方法,并深入剖析调试工具与常见问题定位思路。通过实践示例,引导建立可验证、可回归的工程习惯,从而持续提升代码可靠性与可维护性。

3

2026.02.27

漫蛙app官网链接入口
漫蛙app官网链接入口

漫蛙App官网提供多条稳定入口,包括 https://manwa.me、https

245

2026.02.27

deepseek在线提问
deepseek在线提问

本合集汇总了DeepSeek在线提问技巧与免登录使用入口,助你快速上手AI对话、写作、分析等功能。阅读专题下面的文章了解更多详细内容。

21

2026.02.27

AO3官网直接进入
AO3官网直接进入

AO3官网最新入口合集,汇总2026年可用官方及镜像链接,助你快速稳定访问Archive of Our Own平台。阅读专题下面的文章了解更多详细内容。

403

2026.02.27

热门下载

更多
网站特效
/
网站源码
/
网站素材
/
前端模板

精品课程

更多
相关推荐
/
热门推荐
/
最新课程
SVG 教程
SVG 教程

共20课时 | 12.6万人学习

关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号