来自 Styling Forms with Attribute Selectors - Part 2

表单元素具有3个特征:

The disabled form control does not receive focus 不能获得焦点

The disabled form control is skipped in tabbed navigation 不进入 tab 导航

The information the form control contains does not get sent 不提交值

下面是css代码片段及简单解释

input[type="text"]:disabled{

opacity: .7;

}

不透明度 70%

input[type="text"]:disabled:after {

content: “(disabled - do not use)”;

font-size: .9em;

color: #CCCCCC;

display: block;

}

后面加一句话 “(disabled - do not use)”

input[type="radio"]:checked{

background: #9F393F;

}

多项选择,选中状态背景为 #9F393F