Writing good HTML is a craft

From Garrett Dimon’s Front-End Architecture: Markup is the Technical Foundation

Treat your markup as art. It’s a craft, mold it and tweak it until it’s just right.

Right on. It’s amazing how much easier everything gets when you’re dealing with properly structured markup instead of non-semantic nonsense. Whether you’re applying CSS, manipulating the DOM, adding new content, or restructuring the entire document you will thank yourself (or the person who created the markup) for thinking things through instead of just slapping the markup together.

Of course this isn’t always as easy as you want it to be, especially when there are multiple ways of marking up a particular part of the document. It isn’t always obvious which type of list to choose, for instance. Another difficult scenario is when there is no semantic match in HTML, which means you need to pick the second best option.

Despite the difficulties that occur from time to time I think spending a few minutes to get the markup right is well worth it down the line.

Posted on May 16, 2006 in (X)HTML, Quicklinks


  1. Agreed! However, in a commercial setting there’s definitely a balance to be drawn between making your markup ‘beautiful’ and getting the project done on time.

    The law of diminishing returns applies very strongly here, I think.

    My own pet peeve is poorly marked-up CSS files, where there is no consistency in formatting, little use of shorthand and comments to make it easy to understand.

  2. I agree with you 110%. The real problems lie when the web developer relies solely on a WYSIWYG to create their pages, or update them. From my experience with other ‘web developers’, many of them are lazy and look for the easy way out - as long as its done and the project is done on time (not in regards to Christian’s post above).

    I am a programmer, and the same principles apply. You could easily program a procedural mess all over the place just to get it done, or you could take your time and plan things out - specific to your needs/goals. In the long run, doing it RIGHT the first time will pay off for you, for any other developer that may join the team, and even the website itself.

    Properly structured HTML, properly structured/organized CSS, properly structured JS - all of these help to present a quick loading and easily maintainable website. Otherwise, you end up with tag soup and chaos all over the place and updates now become a nightmare.

    Why is it that people think its just so easy to create web pages? This is really starting to annoy me lately when people don’t take their work seriously. In any other profession, people with that attitude would be out the door in a heartbeat - why is it just accepted for web developers? Lack of knowledge? Ignorance?

    Good read.

  3. I think beutiflu markup helps to get project done on time. After that there is maintanence—and this is where you really appreciate nice code.

  4. Typically money talks with most clients and the majority of them don’t care how well it’s crafted. Assuming if it looks nice on the surface and is done for a low price, must be good.

    However, it’s foolish no to take into account maintenance costs are more likely to be the thing that is more important than a initial lower-cost cowboy code job.

  5. I’ve been handed a few WYSIWYG specials of late to maintain and it’s virtually impossible to do any maintenance on these sites in a timely fashion by just editing the code. I end up having to use DW in design view to even locate certain elements. Returning to properly written mark-up and CSS after that is such a relief.

  6. May 16, 2006 by d_fens

    I spent long enough debating to myself the use of headings ;) But its so much easier changing things when everything is written properally like all good code

  7. Yop, agreed too. I like the word craft a lot.

  8. Mark-up is the pizza base of the web-page world. You can throw all sorts of tasty topings on it, but if the dough is badly mixed and full of all the wrong ingredients your pizza is going to taste pretty bad, and fellow chefs will swear at you.

  9. “Why is it that people think its just so easy to create web pages? ” Unfortunately we have online site builders etc to blame for this - I too am sick and tired of people saying “you just put it all together like a word page dont you” - lol, if only they knew.

  10. Yes it is a craft i really agree, building a steady website, that runs in most browsers and which can undergo time/browser changes is something to invest time in. Although sometimes the time limit AND budget for a website can be stressfull to make it really clean, i try to do it most of the time. I’m still learning the craft everyday.

  11. What grinds my gears is that when I meet people who ask what I do for a living, and I tell them I’m a web designer, they often respond with something along the lines of “Oh, my brother/sister/boyfriend/girlfriend/dog does a bit of that”.

    It’s painful, because 9 times out of ten it turns out that they just “do a bit in the evenings”, and therefore know as much about good design, structure and clean markup as an overboiled carrot. The fact that people like that are compared to professional web designers lowers the whole perception of our trade.

  12. May 17, 2006 by Matthew Pettitt

    The real fun is when you get people who have trained as designers on paper (magazine layout designers, or others of the type) who have thought “I’m a designer, I can do web design”. Then you get a mess of HTML, pages that don’t scale well, and spaghetti code. Oh, and, if they haven’t bothered to look again at the craft since they first noticed it, lots of font tags and no CSS.

    I’m not cynical. Honest!

  13. I agree with you totally. Our team at work has many “frank exchanges of views” about semantics on a regular basis - we all believe in writing clean, crisp, tight code and get super-picky over the cleanliness and semantics of our code.

    We are fortunate in that our clients are increasingly coming to us for that very reason - we simply don’t do old-school development. We even had to teach one of our younger team members how to do table layouts for a one-off HTML email recently as he had only ever learned how to write good code!

    In doing a fair amount of work for UK government and public sector clients we are lucky because there is an automatic mandate to be accessible, and for us good clean code is an essential part of that process.

  14. May 18, 2006 by Paul

    We even had to teach one of our younger team members how to do table layouts for a one-off HTML email recently as he had only ever learned how to write good code!

    I like it!

  15. As a student web designer, I was introduced to a client by my school supervisor. This client explained that he looked for me only because I’m a student.

    He went on to explain that he didn’t expect me to charge much because of the mentioned reason, and also because making a site is very simple as he could just fire up Frontpage and put in a thing or two and voila, he would have a site.

    That left me speechless — not the charging, but the “as simple as” part. I didn’t know how to tell him it’s more than that as he wouldn’t believe someone whom he deemed as unexperienced.


  16. i like you say!!

  17. I happened across this while writing a rant about people confusing the benefits of good HTML with CSS. Almost all the benefits that people attribute to CSS are actually down to having well crafted markup…

Comments are disabled for this post (read why), but if you have spotted an error or have additional info that you think should be in this post, feel free to contact me.