• 纯css实现互动清单


    如图,点击每条信息可以实现删除这条信息的效果。

    <!DOCTYPE html>
    <html lang="en" xmlns="http://www.w3.org/1999/html">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
        <style>
            .cb {
                display: none;
            }
            .mark {
                position: relative;
                display: inline-block;
                 20px;
                height: 20px;
                border: 2px solid transparent;
            }
        .mark:before {
        content: "";
        display: none;
        position: absolute;
        top:50%;
        left: 25%;
        height: 4px;
         8px;
        border: solid black;
        border- 0 0 4px 4px;
        -webkit-transform: rotate(-45deg);
        -moz-transform: rotate(-45deg);
        -ms-transform: rotate(-45deg);
        -o-transform: rotate(-45deg);
        transform: rotate(-45deg);
    }/*画√,这是呈现在页面的钩钩*/
            .cb:checked~ .mark:before {
                display: block;
            }
            .cb:checked~ .con {
                text-decoration: line-through;
            }
        </style>
    </head>
    <body>
    <fieldset>
        <label>
            <input type="checkbox" class="cb" checked>
            <span class="mark"></span>
            <span class="con">this is a test</span>
        </label>
    <br>
        <label>
            <input type="checkbox" class="cb">
            <span class="mark"></span>
            <span class="con">this is a test</span>
        </label>
        <br>
        <label>
            <input type="checkbox" class="cb">
            <span class="mark"></span>
            <span class="con">this is a test</span>
        </label>
    </fieldset>
    </body>
    </html>

     

  • 相关阅读:
    JS面向(基于)对象编程--构造方法(函数)
    一个超简单的马里奥游戏
    JavaScript基于对象编程
    JavaScript基础之函数与数组
    Learn CSS
    The first day of HTML
    mysql cmd 无法登录
    datagrid 扩展 页脚 合计功能
    this高级应用
    (xxx.55).toFixed(1) 无法正确进位处理
  • 原文地址:https://www.cnblogs.com/iriliguo/p/6807631.html
Copyright © 2020-2023  润新知