Laravel  
laravel
文档
数据库
架构
入门
php技术
    
Laravelphp
laravel / php / java / vue / mysql / linux / python / javascript / html / css / c++ / c#

css disabled

作者:农村混血兒   发布日期:2025-06-01   浏览:77

/* 示例代码:使用 CSS 设置禁用样式 */

/* 1. 禁用按钮 */
button:disabled {
    background-color: gray;
    color: white;
    cursor: not-allowed;
}

/* 2. 禁用输入框 */
input:disabled {
    background-color: #e9e9e9;
    color: #aaa;
    cursor: not-allowed;
}

/* 3. 禁用复选框和单选按钮 */
input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 解释说明:
   - :disabled 是 CSS 伪类,用于选择处于禁用状态的表单元素。
   - 背景颜色、文本颜色和光标的样式可以根据需要自定义,以表示元素不可用的状态。
   - 通过设置 `cursor: not-allowed`,当用户将鼠标悬停在禁用元素上时,光标会显示为禁止符号。 */

上一篇:换行css

下一篇:css flex:1

大家都在看

css 红色

css文字超长省略号

css 渐变字体

css背景图片等比例缩放

css文字删除线

css 自定义滚动条

css flex gap

css上一个兄弟元素怎么找到

css文字超出隐藏变省略号鼠标上去展示完整

css文字不允许换行

Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3

Laravel 中文站