您现在的位置是:网站首页> 编程资料编程资料

实例教程 一款纯css3实现的数字统计游戏css3中transform属性实现的4种功能详解CSS3.0(Cascading Style Sheet) 层叠级联样式表纯CSS3实现div按照顺序出入效果CSS3实现列表无限滚动/轮播效果css3 利用transform-origin 实现圆点分布在大圆上布局及旋转特效CSS3实现的侧滑菜单CSS3实现的3D隧道效果用CSS3画一个爱心css3 实现文字闪烁效果的三种方式示例代码六种css3实现的边框过渡效果

2021-09-06 951人已围观

简介 今天介绍一款纯css3实现的数字统计游戏,当你点击数字时,它会自动计算他们之间的和或者是差,这款游戏的规则的是将所有的数字相加等于72。很美观也很好玩,建议大家尝试一下

  今天给大家分享一款纯css3实现的数字统计游戏。这款游戏的规则的是将所有的数字相加等于72。这款游戏的数字按钮做得很美观,需要的时候可以借用下。一起看下效果图:

  实现的代码。

  html代码:

XML/HTML Code复制内容到剪贴板
  1. <h1>  
  2.         CSS Counter Gameh1>  
  3.     <section>  
  4.         <h2>  
  5.             Pick the numbers that add up to 72:h1>  
  6.             <input id="a" type="checkbox"><label for="a">64label>  
  7.             <input id="b" type="checkbox"><label for="b">16label>  
  8.             <input id="c" type="checkbox"><label for="c">-32label>  
  9.             <input id="d" type="checkbox"><label for="d">128label>  
  10.             <input id="e" type="checkbox"><label for="e">4label>  
  11.             <input id="f" type="checkbox"><label for="f">-8label>  
  12.             <span class="sum">span>  
  13.     section>  

  css3代码:

CSS Code复制内容到剪贴板
  1. body   
  2.         {   
  3.             countercounter-reset: sum;   
  4.         }   
  5.            
  6.         #a:checked   
  7.         {   
  8.             countercounter-increment: sum 64;   
  9.         }   
  10.         #b:checked   
  11.         {   
  12.             countercounter-increment: sum 16;   
  13.         }   
  14.         #c:checked   
  15.         {   
  16.             countercounter-increment: sum -32;   
  17.         }   
  18.         #d:checked   
  19.         {   
  20.             countercounter-increment: sum 128;   
  21.         }   
  22.         #e:checked   
  23.         {   
  24.             countercounter-increment: sum 4;   
  25.         }   
  26.         #f:checked   
  27.         {   
  28.             countercounter-increment: sum -8;   
  29.         }   
  30.            
  31.         .sum::before   
  32.         {   
  33.             content'= ' counter(sum);   
  34.         }   
  35.            
  36.         /* the rest is just to make things pretty */  
  37.            
  38.         body   
  39.         {   
  40.             margin32px;   
  41.             font: 700 32px/1 'Droid Sans' , sans-serif;   
  42.             color#fff;   
  43.             background-color#583f3f;   
  44.         }   
  45.            
  46.         h1   
  47.         {   
  48.             margin: 0 0 32px;   
  49.             font-size48px;   
  50.         }   
  51.            
  52.         h2   
  53.         {   
  54.             margin: 0 0 8px 8px;   
  55.             font-size: inherit;   
  56.         }   
  57.            
  58.         section   
  59.         {   
  60.             margin-bottom16px;   
  61.             padding16px;   
  62.             border-radius: 4px;   
  63.             overflowhidden;   
  64.             background-color: rgba(255, 255, 255, .1);   
  65.         }   
  66.            
  67.         input   
  68.         {   
  69.      

相关内容

-六神源码网