zoukankan      html  css  js  c++  java
  • CSS计数器与动态计数呈现

    代码:
    
    CSS代码:
    
    body {
      counter-reset: icecream;
    }
    input:checked {
      counter-increment: icecream;
    }
    .total::after {
      content: counter(icecream);
    }
    HTML代码:
    
    <strong>下面中国十大冰淇淋你吃过几个?</strong>
    <ol>
        <li><input type="checkbox" id="icecream1"><label for="icecream1">哈根达斯</label></li>
        <li><input type="checkbox" id="icecream2"><label for="icecream2">和路雪wall's</label></li>
        <li><input type="checkbox" id="icecream3"><label for="icecream3">八喜冰淇淋</label></li>
        <li><input type="checkbox" id="icecream4"><label for="icecream4">DQ冰淇淋</label></li>
        <li><input type="checkbox" id="icecream5"><label for="icecream5">蒙牛冰淇淋</label></li>
        <li><input type="checkbox" id="icecream6"><label for="icecream6">雀巢冰淇淋</label></li>
        <li><input type="checkbox" id="icecream7"><label for="icecream7">伊利冰淇淋</label></li>    
        <li><input type="checkbox" id="icecream8"><label for="icecream8">乐可可冰淇淋</label></li>
        <li><input type="checkbox" id="icecream9"><label for="icecream9">新城市冰淇淋</label></li>
        <li><input type="checkbox" id="icecream10"><label for="icecream10">明治MEIJI</label></li>
    </ol>
    你总共选择了 <strong class="total"></strong> 款冰淇淋! 

    详细讲解地址:http://www.zhangxinxu.com/wordpress/2014/12/css-counters-pseudo-class-checked-numbers/

  • 相关阅读:
    Apache Kylin v3.0.0-alpha 发布
    Apache Kylin在美团点评的应用
    Kylin 架构模块简介
    Kylin 1 背景、历史与使命
    谈MongoDB的应用场景
    Linux 内存Cache和Buffer理解
    Linux 下查看内存使用情况方法总结
    mongodb 集群配置文件
    MongoDB bindIp 与 bindIpAll
    MongoDB 权限认证
  • 原文地址:https://www.cnblogs.com/MrZouJian/p/5736917.html
Copyright © 2011-2022 走看看