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

推荐订阅源

T
Threatpost
aimingoo的专栏
aimingoo的专栏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Tailwind CSS Blog
J
Java Code Geeks
博客园_首页
Google Online Security Blog
Google Online Security Blog
Hugging Face - Blog
Hugging Face - Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
I
Intezer
P
Palo Alto Networks Blog
V
Vulnerabilities – Threatpost
雷峰网
雷峰网
O
OpenAI News
SecWiki News
SecWiki News
小众软件
小众软件
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
N
News | PayPal Newsroom
Project Zero
Project Zero
Forbes - Security
Forbes - Security
IT之家
IT之家
A
Arctic Wolf
WordPress大学
WordPress大学
Jina AI
Jina AI
T
Tor Project blog
博客园 - 三生石上(FineUI控件)
S
Secure Thoughts
Google DeepMind News
Google DeepMind News
Attack and Defense Labs
Attack and Defense Labs
博客园 - 聂微东
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Privacy International News Feed
Cloudbric
Cloudbric
G
GRAHAM CLULEY
博客园 - 叶小钗
H
Hacker News: Front Page
腾讯CDC
量子位
Help Net Security
Help Net Security
人人都是产品经理
人人都是产品经理
C
Cyber Attacks, Cyber Crime and Cyber Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
宝玉的分享
宝玉的分享
爱范儿
爱范儿
L
Lohrmann on Cybersecurity
Hacker News - Newest:
Hacker News - Newest: "LLM"
Recorded Future
Recorded Future
C
CERT Recently Published Vulnerability Notes

博客园 - 华安

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