一款纯css3实现的数字统计游戏_html/css_WEB-ITnose
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了一款纯css3实现的数字统计游戏_html/css_WEB-ITnose,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2683字,纯文字阅读大概需要4分钟。
内容图文
![一款纯css3实现的数字统计游戏_html/css_WEB-ITnose](/upload/InfoBanner/zyjiaocheng/400/84105f2c87f24335bd2c9d8e899fdc89.jpg)
在线预览 源码下载
实现的代码。
html代码:
CSS Counter Game
Pick the numbers that add up to 72:
css3代码:
body { counter-reset: sum; } #a:checked { counter-increment: sum 64; } #b:checked { counter-increment: sum 16; } #c:checked { counter-increment: sum -32; } #d:checked { counter-increment: sum 128; } #e:checked { counter-increment: sum 4; } #f:checked { counter-increment: sum -8; } .sum::before { content: '= ' counter(sum); } /* the rest is just to make things pretty */ body { margin: 32px; font: 700 32px/1 'Droid Sans' , sans-serif; color: #fff; background-color: #583f3f; } h1 { margin: 0 0 32px; font-size: 48px; } h2 { margin: 0 0 8px 8px; font-size: inherit; } section { margin-bottom: 16px; padding: 16px; border-radius: 4px; overflow: hidden; background-color: rgba(255, 255, 255, .1); } input { position: absolute; left: -9999px; } label { float: left; margin: 8px; padding: 16px; border-radius: 4px; border: solid 2px rgba(255, 255, 255, .4); background-color: rgba(255, 255, 255, .2); cursor: pointer; transition: all .1s; } label::before { display: inline; } input:checked + label { border: solid 2px #fff; background-color: rgba(255, 255, 255, .4); box-shadow: 0 0 10px #fff; } span { float: left; margin: 8px; padding: 18px; border-radius: 4px; background-color: rgba(0, 0, 0, .1); } #a:checked ~ #b:checked ~ #c:not(:checked) ~ #d:not(:checked) ~ #e:not(:checked) ~ #f:checked ~ .sum::after { content: ' (hooray!)'; }
内容总结
以上是互联网集市为您收集整理的一款纯css3实现的数字统计游戏_html/css_WEB-ITnose全部内容,希望文章能够帮你解决一款纯css3实现的数字统计游戏_html/css_WEB-ITnose所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。