例如,哪个更好:
方法1(分别命名类):
@H_301_8@/* CSS */ .textBox-red,.textBox-green { padding: 10px; border: 1px solid #CCC; border-radius: 10px; } .textBox-red { color: #900; } .textBox-green { color: #3c3; } /*HTML*/Box-red">Box-green">
要么 – – – – – –
方法2(链类):
@H_301_8@/* CSS */ .textBox { padding: 10px; border: 1px solid #CCC; border-radius: 10px; } .textBox.text-red { color: #900; } .textBox.text-green { color: #3c3; } /*HTML*/Box text-red">Box text-green">