Are there any good articles on naming comprehensive naming conventions?
I’m looking to clean up some code… everything from assets to models (Codeigniter) to HTML and CSS.
I’m also curious how to structure the CSS… is it better to give everything a unique class ie search-bar-icon or is it better to repeat classes like .search span.icon {?
Thanks,
Walker
In HTML/CSS, the id and class selectors are not equivalent. The id carries more weight, so it should be used sparingly. Use it for sections of a page where you have descendant selectors whose class names are the same as other sections but you wish them to be styled differently. Think of the id like a poor man’s namespacing for page regions.