Grow your CSS skills. Land your dream job.

Guest Post on Writing Better HTML

Published by Chris Coyier

I was flattered when the guys from Smashing Magazine asked me if I'd like to write an article for them. I thought I would stick to my best subject and write about CSS at first. So I started a draft about developing good CSS habits. The first section was about how CSS doesn't live in a bubble and needs good HTML to go around it. In fact, good HTML is almost MORE important. That first section went on and on and on and eventually I decided that I was actually writing an article about developing good HTML habits instead! Here is is:

12 Principles For Keeping Your Code Clean


  1. Permalink to comment#

    Cool stuff.

  2. mikemc
    Permalink to comment#

    Nice article Chris. Read last night and bookmarked for later reference.

  3. brad dunbar
    Permalink to comment#

    Great article Chris! Reminders about clean code are always welcome.

  4. Permalink to comment#

    Imust admit, I have got soo much better with clean code – CSS actually helps keep it clean too… so its win win! Still loads of room for improvment though :) nice post, thanks :)

  5. Permalink to comment#

    Great Article Chris! I never really fully understood the doctypes, so I always used XHTML 1.0 Transitional… From now on, I will start using Strict in my designs… Thanks again for offering such great information to the community!

  6. Permalink to comment#

    Hey Chris. Good stuff @ SM.

    First thing I did this morning was go to SmashingMag (as I do every morning, afternoon, evening, fourthmeal…). I skipped right to the content and read through the list, and as I was reading I thought to myself, “This looks like Chris Coyier work…”. So, I scrolled back up and sure enough…”By Chris…”.

    Good stuff.

  7. Permalink to comment#

    hey, congrats on the diggs man!

  8. Very helpful post, and I can say my site is very clean!

  9. wilhel1812
    Permalink to comment#

    Congrats for being featured on smashingmagazine, Chris! I didn’t realize it was you who wrote that exellent pos :)

  10. Permalink to comment#

    Great article over there. I couldn’t believe how many people argued for using tables.

    I made a post yesterday on my site about comments on a link on Reddit that were filled with table-based layout enthusiasts…. I can’t believe it’s even a discussion anymore. Are they just amateurs? Ugh.

  11. Fantastic. Love the screenshots with the handwriting font. Love the resource links too.

    I am going to try and get all my coworkers to read this. Sigh. They tend to code like it’s 1989.

  12. Permalink to comment#

    I read the article and loved it. I didn’t even think to look who wrote it. I’m pleasantly surprised that it was from someone whose stuff I read on a regular basis.

  13. The font is a freebie Jessi, in case you ever want to use it:

  14. Permalink to comment#

    Hey Chris, good article but in #7 you say not to use presentational class/id’s. This is very very true but you then go on to use a presentational class – .sidebar – in #9 which describes the design not the content. Just saying.

  15. Manko10
    Permalink to comment#

    Hi Chris,

    I decided to post more comments because I think writers should know their readers. ;-)
    I really agree with you in the most aspects but I’m not credited on the “divitis”. Of course, many people write DIVs a lot as they must save their life using DIVs but in many cases a wrapping DIV can be very useful. Have a look at YAML (Yet Another Multicolumn Layout – not Yet Another Markup Language). There are many DIVs in use but not because the author likes them. They’re used because it improves the layout’s flexibility and helps to make IE 6 showing the page correctly.

  16. Permalink to comment#

    Hey Chris,

    I read the article a few days back.
    Great job and congratulations!

  17. Permalink to comment#

    No way I was digging through old stared RSS items and I came across that one, and right after finishing reading it, this was the next tutorial on the list.

This comment thread is closed. If you have important information to share, you can always contact me.

*May or may not contain any actual "CSS" or "Tricks".