C语言六边形蜂巢数组,关于使用svg构建六边形蜂巢列表的方式

ul,p{margin:0;padding:0;

}ul{list-style:none;border:1px solid #333333;overflow:hidden;

}li.hex{float:left;font-size:20px;

}svg{width:100%;color:#3bc292;

}svg path{fill:transparent; /*内部透明填充色*/stroke:#3bc292; /*边框色*/stroke-width:6; /*边框宽度*/stroke-linecap:round; /*描边端点表现形式*/stroke-linejoin:round; /*描边转角的表现方式*/stroke-miterlimit:4;stroke-dasharray:20; /*创建虚线,20px实线,20px虚线重复*/animation:dash 5s linear infinite; /*动画名 每次速度 匀速 无限次*/transition:0.3s;-moz-transition:0.3s; /*Firefox 4*/-webkit-transition:0.3s; /*Safari 和 Chrome*/-o-transition:0.3s; /*Opera*/

}svg text{fill:#3bc292; /*文本填充色*/transition:0.3s;-moz-transition:0.3s; /*Firefox 4*/-webkit-transition:0.3s; /*Safari 和 Chrome*/-o-transition:0.3s; /*Opera*/

}svg text.time{font-size:0.8em;

}svg p.title{text-align:center;font-size:1.5em;transition:0.3s;-moz-transition:0.3s; /*Firefox 4*/-webkit-transition:0.3s; /*Safari 和 Chrome*/-o-transition:0.3s; /*Opera*/

}svg text.num{font-size:0.8em;

}svg:hover path{stroke:#3bc292;fill:#69c2a3;

}svg:hover text, svg:hover p.title{fill:#ffffff;color:#ffffff;

}svg.red path{stroke:#f56f6f;animation-play-state:paused;

}svg.red:hover path{fill:#f56f6f;

}svg.yellow path{stroke:#f5b140;animation-play-state:paused;

}svg.yellow:hover path{fill:#f5b140;

}@keyframes dash{to {

stroke-dashoffset:120; /*虚线在原路径下的偏移量*/

}}/*** SPACING AND SIZING *****************************************************************/@media (min-width: 1401px){.hex {

width:12.5%;margin:0 0.5%;

}.hex:nth-child(13n+1){margin-left:2.5%;

}.hex:nth-child(13n+8),.hex:nth-child(13n+9),.hex:nth-child(13n+10),.hex:nth-child(13n+11),.hex:nth-child(13n+12),.hex:nth-child(13n+13){margin-top:-3%;margin-bottom:-3%;

}.hex:nth-child(13n+8){margin-left:9.25%;

}}

@media (max-width: 1400px) and (min-width: 1201px){.hex {

width:15%;margin:0 0.5%;

}.hex:nth-child(11n+1){margin-left:2.5%;

}.hex:nth-child(11n+7),.hex:nth-child(11n+8),.hex:nth-child(11n+9),.hex:nth-child(11n+10),.hex:nth-child(11n+11){margin-top:-3.6%;margin-bottom:-3.6%;

}.hex:nth-child(11n+7){margin-left:10.5%;

}}

@media (max-width: 1200px) and (min-width: 901px){.hex {

width:19%;margin:0 0.3%;

}.hex:nth-child(9n+1){margin-left:1%;

}.hex:nth-child(9n+6),.hex:nth-child(9n+7),.hex:nth-child(9n+8),.hex:nth-child(9n+9){margin-top:-4.6%;margin-bottom:-4.6%;

}.hex:nth-child(9n+6){margin-left:10.5%;

}}

@media (max-width: 900px) and (min-width: 601px){.hex {

width:24%;margin:0 0.3%;

}.hex:nth-child(7n+1){margin-left:0.8%;

}.hex:nth-child(7n+5),.hex:nth-child(7n+6),.hex:nth-child(7n+7){margin-top:-6%;margin-bottom:-6%;

}.hex:nth-child(7n+5){margin-left:13.1%;

}}

@media (max-width: 600px){.hex {

width:30%;margin:0 1%;

}.hex:nth-child(5n+1){margin-left:3%;

}.hex:nth-child(5n+4),.hex:nth-child(5n+5){margin-top:-6.5%;margin-bottom:-6.5%;

}.hex:nth-child(5n+4){margin-left:19%;

}}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值