惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

SecWiki News
SecWiki News
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
博客园 - 叶小钗
S
SegmentFault 最新的问题
IT之家
IT之家
大猫的无限游戏
大猫的无限游戏
博客园_首页
Apple Machine Learning Research
Apple Machine Learning Research
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
月光博客
月光博客
酷 壳 – CoolShell
酷 壳 – CoolShell
腾讯CDC
D
Darknet – Hacking Tools, Hacker News & Cyber Security
V
V2EX
阮一峰的网络日志
阮一峰的网络日志
L
Lohrmann on Cybersecurity
量子位
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tor Project blog
J
Java Code Geeks
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
博客园 - 三生石上(FineUI控件)
Attack and Defense Labs
Attack and Defense Labs
AI
AI
The Cloudflare Blog
T
Tailwind CSS Blog
S
Schneier on Security
爱范儿
爱范儿
PCI Perspectives
PCI Perspectives
Stack Overflow Blog
Stack Overflow Blog
S
Secure Thoughts
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
T
The Exploit Database - CXSecurity.com
博客园 - 【当耐特】
V2EX - 技术
V2EX - 技术
S
Securelist
P
Proofpoint News Feed
T
Threat Research - Cisco Blogs
Help Net Security
Help Net Security
C
Cisco Blogs
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
K
Kaspersky official blog
T
The Blog of Author Tim Ferriss
G
Google Developers Blog
S
Security Affairs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Simon Willison's Weblog
Simon Willison's Weblog

博客园 - 华安

Unity 相机:正交 (Orthographic) vs 透视 (Perspective) - 华安 unity中的button中的onclick控制面板中四个参数的意思分别是什么 - 华安 微信小程序开发中触发 onshow的几种特殊情况 SQL Server备份心得 MYSQL 备份数据库 微信与支付支付功能开发 微信小程序中页面配置下拉刷新 unity中 相机没有视锥效果线框了,如何打开 JSONPath表达式 C# 中的操作JSON类 JObject cookie中的 HttpOnly 、Secure、SameSite 解释 Spring-boot 中基于 IP 的限流和自动封禁 Filter 登录 用 HMAC-SHA256 实现 TwoFA(二重验证)的坑 利用Spring Boot的 filter 结合ConcurrentHashMap 实现“同一IP每分钟最多允许300个404请求,超出后禁用30分钟访问” pixi-filters中的BackdropBlurFilter使用注意事项 PixiJS中的 SplitBitmapText.chars中的每个 BitmapText的x值分析 legend隐藏不想显示的图例 spring-boot HttpServletResponse response.sendRedirect是会跳转到 http而不是https springboot获取post请求参数 Javascript如何判断是触摸屏还是PC端 JavaScript获取鼠标点一个元素,获取鼠标点击的元素内的位置 spring-boot中配置Mongodbd的问题小结 Rest Template中添加 PATCH请求。 SpringBoot+Thyemleaf报错:Error resolving template Template might not exist or might not be accessible div display flex 如何出现横向滚动条
CSS实现修改CheckBox样式
华安 · 2025-11-18 · via 博客园 - 华安

checkbox的代码:

 <div>
        <input type="checkbox" id="custom-checkbox" class="custom-checkbox">
        <label for="custom-checkbox"></label>
    </div>

CSS代码:

 <style type="text/css">
        .custom-checkbox {
            opacity: 0; /* 完全透明 */
            position: absolute; /* 移出可视区域 */
            pointer-events: none; /* 使其不响应用户操作 */
        }

        .custom-checkbox + label {
            position: relative; /* 相对于这个元素定位 */
            padding-left: 25px; /* 留出空间给自定义复选框 */
            cursor: pointer; /* 鼠标悬停时显示手形图标 */
        }

        .custom-checkbox + label:before {
            content: ''; /* 必须有内容才能使伪元素显示 */
            display: block; /* 将伪元素作为块级元素处理 */
            width: 16px; /* 宽度 */
            height: 16px; /* 高度 */
            background: white; /* 背景色 */
            border: 1px solid #ccc; /* 边框 */
            position: absolute; /* 绝对定位 */
            left: 0; /* 相对于父元素的左侧对齐 */
            top: 0; /* 相对于父元素的顶部对齐 */
            border-radius: 3px; /* 圆角 */
        }

        .custom-checkbox:checked + label:before {
            background: #007bff; /* 选中时的背景色 */
            border-color: #007bff; /* 选中时的边框色 */
        }
        .custom-checkbox:checked + label:after {
            display: block; /* 在复选框选中时显示对勾 */
        }

    </style>

运行效果:

QQ_1763469041082 未选中

QQ_1763469069607选中后