While at the moment you're building a site for a web development company in london, what happens when you want to reuse the code for a web development company in new york? or what about a craft store in london? It seems trivial now, since you're writing the code, but what if you've got a team? The best practice is to use names that make sense to the page at hand. If you bring the page up on the screen, anybody should be able to identify major components: header, footer, navigation, etc., etc.
While IDs and classes should be descriptive like Christoper Altman posted (.warningtext
v .redtext
) there's no need to overload them with information (.thisTextAppearsWhenTheUserEntersTheirNameInThePhoneNumberArea
is a bit silly) so there's a balance to be struck. Generally as a rule, I try to use the minimum description to specifically tag a section, both to simplifiy my codes appearance and my unhealthy obsession with speed.
In short, if all you need to correctly ID a section is header, then use header. No need to introduce more information if it doesn't have a purpose.