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

推荐订阅源

B
Blog RSS Feed
Spread Privacy
Spread Privacy
T
Threatpost
C
Cisco Blogs
P
Palo Alto Networks Blog
AI
AI
Cyberwarzone
Cyberwarzone
NISL@THU
NISL@THU
P
Privacy & Cybersecurity Law Blog
G
GRAHAM CLULEY
Simon Willison's Weblog
Simon Willison's Weblog
T
Tor Project blog
Latest news
Latest news
AWS News Blog
AWS News Blog
D
Docker
S
SegmentFault 最新的问题
博客园 - 聂微东
WordPress大学
WordPress大学
Vercel News
Vercel News
S
Securelist
爱范儿
爱范儿
J
Java Code Geeks
Know Your Adversary
Know Your Adversary
S
Schneier on Security
Hugging Face - Blog
Hugging Face - Blog
F
Fortinet All Blogs
Last Week in AI
Last Week in AI
D
DataBreaches.Net
宝玉的分享
宝玉的分享
D
Darknet – Hacking Tools, Hacker News & Cyber Security
MongoDB | Blog
MongoDB | Blog
Engineering at Meta
Engineering at Meta
K
Kaspersky official blog
美团技术团队
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
量子位
博客园_首页
Attack and Defense Labs
Attack and Defense Labs
S
Secure Thoughts
Google Online Security Blog
Google Online Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
腾讯CDC
T
Threat Research - Cisco Blogs
雷峰网
雷峰网
有赞技术团队
有赞技术团队
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Privacy International News Feed
S
Security Affairs

博客园 - 华安

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选中后