我的css选择符命名
网上找不到合适的参考,只好自己揣摩一套。
目的是为了达到更好的语义化、可读性。我开始相对严格试用以下ID和CLASS的命名。
如果大家有好的提议,或者对以下的命名有意见,请你提出,我很欢迎指出问题。
Since reader friendly. With naming, from right now.
* How to read my CSS Selector? With naming from right now.
* ID - Words with mixed case and dash, Never underline.
Example:
#PostLists {}
#post {}
#post-121 {}
#post-acol-121 {}
* CLASS - Words with mixed case, initial letter of lowercase, Never underline and dash.
Example:
.album {}
.albumlist {}
.albumlistTemp1 {}
.albumlistTemp2 {}