1MB Club

Write HTML Like It's 1999

I am sure it’s safe to say that most developers love to use the latest and greatest web tools available. Helpful resources such as preprocessors, template engines, syntax formatters - you name it - can all make a developer’s life easier. Unfortunately, this sometimes comes at a cost: the HTML structure.

This is why I try my best to write HTML as if I’m stuck with the constraints of the 90s (within reason). What does this mean exactly? It means that tables are coded with table elements. Navigations are coded with nav and ordered/unordered list-items. Form inputs are not set with display: none and replaced with custom containers. You know, semantic HTML.

To be clear, I’m not advocating for creating projects that look like they belong in the 1990s. I would just prefer developers / designers be more conscious of their HTML skeleton.

Bad HTML practices

Let’s do a very simple breakdown of some of the more common HTML no-nos:

Good HTML practices

So what should you do in place of these bad HTML implementations?

My basic “structure” test

I’ve found a pretty simple starting point for testing the bones of a website by using the following single line of CSS:

* {
    border: 2px dotted black;
}

This property simply outlines all elements on the current page in a dotted border. By placing a border on every HTML element you can instantly see how overly complex or ugly your structure might be under the hood.

“Thanks, Captain Obvious!”

I know, this stuff is pretty basic. The point of this post isn’t to tell you (developers) something brand new or mind-blowing, but instead should inspire you to keep things simple.

Don’t forget that there is always someone new into the world of design and development. Hopefully this post steers others towards keeping HTML code semantic and clean. ✌️

Update to this article

Since this post received so much more attention than I ever expected, I’ve decided to touch on a few small points brought up in the comments.

  1. What is the benefit of semantic HTML?
  2. Tables not being responsive
  3. Instead of the CSS one-liner, simply use Firefox debugger

Special Thanks

I'm extremely grateful for the support from the "Hall of Fame" supporters:
abakada.org adast.dk alessandrocuzzocrea.com alexeystar.com arc-x.org artemislena.eu b0ba.dev danielsada.tech devitjobs.uk dieses-veganismus.de gtrr.artemislena.eu iosis-labs.com jakobmagnusson.se jamieonkeys.dev kristianscott.co.uk lukealexdavis.co.uk miniskirt.me simone.org t0.vc tedmagaoay.com willem.com wonger.dev xslendi.xyz zoraster.org

If you too would like to support this project and help fund more articles like this one:
Become a supporter today →