4 ms·
Ask HN: HTML/CSS code guide
I’ve managed to get bogged down by my own verbosity and I need a fresh approach to HTML and CSS.
I’m looking around for a boilerplate for a sensible HTML and/or CSS style guide that’s considered industry standard, or at least sufficiently neutral/accepted/non-controversial enough for when my code is passed on to other web developers so that they don’t need to reinvent the wheel each time.
I’ve collected and culled a short list of guides and will be looking through for inspiration, some of which are:
* Mark Otto’s code guide: https://github.com/mdo/code-guide
* 18F’s CSS guide: https://18f.gsa.gov/2016/01/11/introducing-the-css-coding-style-guide/
* Google style guide: https://google.github.io/styleguide/htmlcssguide.xml
There are many more of these around the web, and I don't need to invent a(nother) new one.
Do you have a preferred or recommended HTML/CSS style guide? I'd appreciate a pointer.
Thanks very much in advance.
- brudgers 10y agoThe wonderful thing about standards is that there are so many of them to choose from. Standards, like compilers and text editors and monitors, are tools that solve one or more of someone's problems. Google's standards solve some of Google's problems. 18F's standards solve a Federal Government Agency's problems. Mark Otto's 'standard' solves Mark Otto's problems. That doesn't mean that any of them will solve your 'problems'. You're not facing the challenges of a Google or a government and probably not the maintainer of an OSS project equivalent to Bootstrap. The purpose of standards is to make your life easier: it is not maintaining standards for their own sake. It's worth studying standards. It's also worth studying your specific problems. It's probably worth keeping in mind that whoever gets your code next won't like your standard or won't like standards at all. What's better than a standard is tooling that automates compliance, for example Lint. Good luck.