Appearance
:optional 伪类选择没有 required 属性的表单元素。
selector:optional { property: value; }
/* 可选输入框 */ input:optional { border-color: #ccc; } /* 可选字段 */ input:optional::after { content: " (可选)"; color: #666; } /* 可选选择框 */ select:optional { background-color: white; }