30 HTML and CSS Musts for Beginners
basix

30 HTML Best Practices for Beginners

The most difficult aspect of running Nettuts+ is accounting for so many different skill levels. If we post too many advanced tutorials, our beginner audience won’t benefit. The same holds true for the opposite. We do our best, but always feel free to pipe in if you feel you’re being neglected. This site is for you, so speak up! With that said, today’s tutorial is specifically for those who are just diving into web development. If you’ve one year of experience or less, hopefully some of the tips listed here will help you to become better, quicker!

Without further ado, let’s review thirty best practices to observe when creating your markup.


1: Always Close Your Tags

Back in the day, it wasn’t uncommon to see things like this:

<li>Some text here.
<li>Some new text here.
<li>You get the idea.

Notice how the wrapping UL/OL tag was omitted. Additionally, many chose to leave off the closing LI tags as well. By today’s standards, this is simply bad practice and should be 100% avoided. Always, always close your tags. Otherwise, you’ll encounter validation and glitch issues at every turn.

Better

<ul>
  <li>Some text here. </li>
  <li>Some new text here. </li>
  <li>You get the idea. </li>
</ul>

2: Declare the Correct DocType

Declare doctype

When I was younger, I participated quite a bit in CSS forums. Whenever a user had an issue, before we would look at their situation, they HAD to perform two things first:

  1. Validate the CSS file. Fix any necessary errors.
  2. Add a doctype.

“The DOCTYPE goes before the opening html tag at the top of the page and tells the browser whether the page contains HTML, XHTML, or a mix of both, so that it can correctly interpret the markup.”

Most of us choose between four different doctypes when creating new websites.

  1. <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd”>
  2. <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>
  3. <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
  4. <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>

There’s a big debate currently going on about the correct choice here. At one point, it was considered to be best practice to use the XHTML Strict version. However, after some research, it was realized that most browsers revert back to regular HTML when interpretting it. For that reason, many have chosen to use HTML 4.01 Strict instead. The bottom line is that any of these will keep you in check. Do some research and make up your own mind.


3: Never Use Inline Styles

When you’re hard at work on your markup, sometimes it can be tempting to take the easy route and sneak in a bit of styling.

<p style="color: red;">I'm going to make this text red so that it really stands out and makes people take notice! </p>

Sure — it looks harmless enough. However, this points to an error in your coding practices.

    When creating your markup, don’t even think about the styling yet. You only begin adding styles once the page has been completely coded.

It’s like crossing the streams in Ghostbusters. It’s just not a good idea.
-Chris Coyier (in reference to something completely unrelated.)

Instead, finish your markup, and then reference that P tag from your external stylesheet.

Better

#someElement > p {
  color: red;
}

4: Place all External CSS Files Within the Head Tag

Technically, you can place stylesheets anywhere you like. However, the HTML specification recommends that they be placed within the document HEAD tag. The primary benefit is that your pages will seemingly load faster.

While researching performance at Yahoo!, we discovered that moving stylesheets to the document HEAD makes pages appear to be loading faster. This is because putting stylesheets in the HEAD allows the page to render progressively.
- ySlow Team

<head>
<title>My Favorites Kinds of Corn</title>
<link rel="stylesheet" type="text/css" media="screen" href="path/to/file.css" />
<link rel="stylesheet" type="text/css" media="screen" href="path/to/anotherFile.css" />
</head>

5: Consider Placing Javascript Files at the Bottom

Place JS at bottom

Remember — the primary goal is to make the page load as quickly as possible for the user. When loading a script, the browser can’t continue on until the entire file has been loaded. Thus, the user will have to wait longer before noticing any progress.

If you have JS files whose only purpose is to add functionality — for example, after a button is clicked — go ahead and place those files at the bottom, just before the closing body tag. This is absolutely a best practice.

Better

<p>And now you know my favorite kinds of corn. </p>
<script type="text/javascript" src="path/to/file.js"></script>
<script type="text/javascript" src="path/to/anotherFile.js"></script>
</body>
</html>

6: Never Use Inline Javascript. It’s not 1996!

Another common practice years ago was to place JS commands directly within tags. This was very common with simple image galleries. Essentially, a “onclick” attribute was appended to the tag. The value would then be equal to some JS procedure. Needless to say, you should never, ever do this. Instead, transfer this code to an external JS file and use “addEventListener/attachEvent” to “listen” for your desired event. Or, if using a framework like jQuery, just use the “click” method.

$('a#moreCornInfoLink').click(function() {
  alert('Want to learn more about corn?');
});

7: Validate Continuously

validate continuously

I recently blogged about how the idea of validation has been completely misconstrued by those who don’t completely understand its purpose. As I mention in the article, “validation should work for you, not against.”

However, especially when first getting started, I highly recommend that you download the Web Developer Toolbar and use the “Validate HTML” and “Validate CSS” options continuously. While CSS is a somewhat easy to language to learn, it can also make you tear your hair out. As you’ll find, many times, it’s your shabby markup that’s causing that strange whitespace issue on the page. Validate, validate, validate.


8: Download Firebug

download firebug

I can’t recommend this one enough. Firebug is, without doubt, the best plugin you’ll ever use when creating websites. Not only does it provide incredible Javascript debugging, but you’ll also learn how to pinpoint which elements are inheriting that extra padding that you were unaware of. Download it!


9: Use Firebug!

use firebug

From my experiences, many users only take advantage of about 20% of Firebug’s capabilities. You’re truly doing yourself a disservice. Take a couple hours and scour the web for every worthy tutorial you can find on the subject.

Resources


10: Keep Your Tag Names Lowercase

Technically, you can get away with capitalizing your tag names.

<DIV>
<P>Here's an interesting fact about corn. </P>
</DIV>

Having said that, please don’t. It serves no purpose and hurts my eyes — not to mention the fact that it reminds me of Microsoft Word’s html function!

Better

<div>
<p>Here's an interesting fact about corn. </p>
</div>

11: Use H1 – H6 Tags

Admittedly, this is something I tend to slack on. It’s best practice to use all six of these tags. If I’m honest, I usually only implement the top four; but I’m working on it! :) For semantic and SEO reasons, force yourself to replace that P tag with an H6 when appropriate.

<h1>This is a really important corn fact! </h1>
<h6>Small, but still significant corn fact goes here. </h6>

12: If Building a Blog, Save the H1 for the Article Title

h1 saved for title of article.

Just this morning, on Twitter, I asked our followers whether they felt it was smartest to place the H1 tag as the logo, or to instead use it as the article’s title. Around 80% of the returned tweets were in favor of the latter method.

As with anything, determine what’s best for your own website. However, if building a blog, I’d recommend that you save your H1 tags for your article title. For SEO purposes, this is a better practice – in my opinion.


13: Download ySlow

Especially in the last few years, the Yahoo team has been doing some really great work in our field. Not too long ago, they released an extension for Firebug called ySlow. When activated, it will analyze the given website and return a “report card” of sorts which details the areas where your site needs improvement. It can be a bit harsh, but it’s all for the greater good. I highly recommend it.


14: Wrap Navigation with an Unordered List

Wrap navigation with unordered lists

Each and every website has a navigation section of some sort. While you can definitely get away with formatting it like so:

 <div id="nav">
  <a href="#">Home </a>
   <a href="#">About </a>
   <a href="#">Contact </a>
 </div>

I’d encourage you not to use this method, for semantic reasons. Your job is to write the best possible code that you’re capable of.

Why would we style a list of navigation links with anything other than an unordered LIST?

The UL tag is meant to contain a list of items.

Better

<ul id="nav">
  <li><a href="#">Home</a></li>
  <li><a href="#">About</a></li>
  <li><a href="#">Contact</a></li>
</ul>

15: Learn How to Target IE

You’ll undoubtedly find yourself screaming at IE during some point or another. It’s actually become a bonding experience for the community. When I read on Twitter how one of my buddies is battling the forces of IE, I just smile and think, “I know how you feel, pal.”

The first step, once you’ve completed your primary CSS file, is to create a unique “ie.css” file. You can then reference it only for IE by using the following code.

<!--[if lt IE 7]>
   <link rel="stylesheet" type="text/css" media="screen" href="path/to/ie.css" />
<![endif]--> 

This code says, “If the user’s browser is Internet Explorer 6 or lower, import this stylesheet. Otherwise, do nothing.” If you need to compensate for IE7 as well, simply replace “lt” with “lte” (less than or equal to).


16: Choose a Great Code Editor

choose a great code editor

Whether you’re on Windows or a Mac, there are plenty of fantastic code editors that will work wonderfully for you. Personally, I have a Mac and PC side-by-side that I use throughout my day. As a result, I’ve developed a pretty good knowledge of what’s available. Here are my top choices/recommendations in order:

Mac Lovers

PC Lovers


17: Once the Website is Complete, Compress!

Compress

By zipping your CSS and Javascript files, you can reduce the size of each file by a substantial 25% or so. Please don’t bother doing this while still in development. However, once the site is, more-or-less, complete, utilize a few online compression programs to save yourself some bandwidth.

Javascript Compression Services

CSS Compression Services


18: Cut, Cut, Cut

cut cut cut

Looking back on my first website, I must have had a SEVERE case of divitis. Your natural instinct is to safely wrap each paragraph with a div, and then wrap it with one more div for good measure. As you’ll quickly learn, this is highly inefficient.

Once you’ve completed your markup, go over it two more times and find ways to reduce the number of elements on the page. Does that UL really need its own wrapping div? I think not.

Just as the key to writing is to “cut, cut, cut,” the same holds true for your markup.


19: All Images Require “Alt” Attributes

It’s easy to ignore the necessity for alt attributes within image tags. Nevertheless, it’s very important, for accessibility and validation reasons, that you take an extra moment to fill these sections in.

Bad

<IMG SRC="cornImage.jpg" />

Better

<img src="cornImage.jpg" alt="A corn field I visited." />

20: Stay up Late

I highly doubt that I’m the only one who, at one point while learning, looked up and realized that I was in a pitch-dark room well into the early, early morning. If you’ve found yourself in a similar situation, rest assured that you’ve chosen the right field.

The amazing “AHHA” moments, at least for me, always occur late at night. This was the case when I first began to understand exactly what Javascript closures were. It’s a great feeling that you need to experience, if you haven’t already.


21: View Source

view source

What better way to learn HTML than to copy your heroes? Initially, we’re all copiers! Then slowly, you begin to develop your own styles/methods. So visit the websites of those you respect. How did they code this and that section? Learn and copy from them. We all did it, and you should too. (Don’t steal the design; just learn from the coding style.)

Notice any cool Javascript effects that you’d like to learn? It’s likely that he’s using a plugin to accomplish the effect. View the source and search the HEAD tag for the name of the script. Then Google it and implement it into your own site! Yay.


22: Style ALL Elements

This best practice is especially true when designing for clients. Just because you haven’t use a blockquote doesn’t mean that the client won’t. Never use ordered lists? That doesn’t mean he won’t! Do yourself a service and create a special page specifically to show off the styling of every element: ul, ol, p, h1-h6, blockquotes, etc.


23: Use Twitter

Use Twitter

Lately, I can’t turn on the TV without hearing a reference to Twitter; it’s really become rather obnoxious. I don’t have a desire to listen to Larry King advertise his Twitter account – which we all know he doesn’t manually update. Yay for assistants! Also, how many moms signed up for accounts after Oprah’s approval? We can only long for the day when it was just a few of us who were aware of the service and its “water cooler” potential.

Initially, the idea behind Twitter was to post “what you were doing.” Though this still holds true to a small extent, it’s become much more of a networking tool in our industry. If a web dev writer that I admire posts a link to an article he found interesting, you better believe that I’m going to check it out as well – and you should too! This is the reason why sites like Digg are quickly becoming more and more nervous.

Twitter Snippet

If you just signed up, don’t forget to follow us: NETTUTS.


24: Learn Photoshop

Learn Photoshop

A recent commenter on Nettuts+ attacked us for posting a few recommendations from Psdtuts+. He argued that Photoshop tutorials have no business on a web development blog. I’m not sure about him, but Photoshop is open pretty much 24/7 on my computer.

In fact, Photoshop may very well become the more important tool you have. Once you’ve learned HTML and CSS, I would personally recommend that you then learn as many Photoshop techniques as possible.

  1. Visit the Videos section at Psdtuts+
  2. Fork over $25 to sign up for a one-month membership to Lynda.com. Watch every video you can find.
  3. Enjoy the “You Suck at Photoshop” series.
  4. Take a few hours to memorize as many PS keyboard shortcuts as you can.

25: Learn Each HTML Tag

There are literally dozens of HTML tags that you won’t come across every day. Nevertheless, that doesn’t mean you shouldn’t learn them! Are you familiar with the “abbr” tag? What about “cite”? These two alone deserve a spot in your tool-chest. Learn all of them!

By the way, in case you’re unfamiliar with the two listed above:

  • abbr does pretty much what you’d expect. It refers to an abbreviation. “Blvd” could be wrapped in a <abbr> tag because it’s an abbreviation for “boulevard”.
  • cite is used to reference the title of some work. For example, if you reference this article on your own blog, you could put “30 HTML Best Practices for Beginners” within a <cite> tag. Note that it shouldn’t be used to reference the author of a quote. This is a common misconception.

26: Participate in the Community

Just as sites like ours contributes greatly to further a web developer’s knowledge, you should too! Finally figured out how to float your elements correctly? Make a blog posting to teach others how. There will always be those with less experience than you. Not only will you be contributing to the community, but you’ll also teach yourself. Ever notice how you don’t truly understand something until you’re forced to teach it?


27: Use a CSS Reset

This is another area that’s been debated to death. CSS resets: to use or not to use; that is the question. If I were to offer my own personal advice, I’d 100% recommend that you create your own reset file. Begin by downloading a popular one, like Eric Meyer’s, and then slowly, as you learn more, begin to modify it into your own. If you don’t do this, you won’t truly understand why your list items are receiving that extra bit of padding when you didn’t specify it anywhere in your CSS file. Save yourself the anger and reset everything! This one should get you started.

html, body, div, span, 
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
img, ins, kbd, q, s, samp,
small, strike, strong, 
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
	margin: 0;
	padding: 0;
	border: 0;
	outline: 0;
	font-size: 100%;
	vertical-align: baseline;
	background: transparent;
}
body {
	line-height: 1;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}

table {
	border-collapse: collapse;
	border-spacing: 0;
}

28: Line ‘em Up!

Generally speaking, you should strive to line up your elements as best as possible. Take a look at you favorite designs. Did you notice how each heading, icon, paragraph, and logo lines up with something else on the page? Not doing this is one of the biggest signs of a beginner. Think of it this way: If I ask why you placed an element in that spot, you should be able to give me an exact reason.


29: Slice a PSD

Slice a PSD

Okay, so you’ve gained a solid grasp of HTML, CSS, and Photoshop. The next step is to convert your first PSD into a working website. Don’t worry; it’s not as tough as you might think. I can’t think of a better way to put your skills to the test. If you need assistance, review these in depth video tutorials that show you exactly how to get the job done.


30: Don’t Use a Framework…Yet

Frameworks, whether they be for Javascript or CSS are fantastic; but please don’t use them when first getting started. Though it could be argued that jQuery and Javascript can be learned simultaneously, the same can’t be made for CSS. I’ve personally promoted the 960 CSS Framework, and use it often. Having said that, if you’re still in the process of learning CSS — meaning the first year — you’ll only make yourself more confused if you use one.

CSS frameworks are for experienced developers who want to save themselves a bit of time. They’re not for beginners.


Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • Tracepoint

    Pretty awesome list; if you haven’t got the fundamentals you haven’t got anything.

  • http://creativityden.com/ Liam McCabe

    Amazing work Jeff!

    Great tips!

  • http://www.jeff-way.com Jeffrey Way
    Author

    Thanks guys. If it helped, please retweet or Digg it. These things take forever! :)

    • http://twitter.com/vastudio Meshach

      Dugg and retweeted. Thanks for the awesome article Jeffrey!

    • kirie

      usefull yes,

      but i think this is not for beginner,
      like validation and reset.css

      will just confusing beginner rather than helping them

      • http://www.jeff-way.com Jeffrey Way
        Author

        Validation is primarily for beginners. They’re the ones who make the most mistakes.

    • http://www.qimingweng.com Qiming

      Dugg.

      Amazing article, I wish I had this kind of resource when I started a while ago :)

  • The Captain

    Pretty good! Wish I had this when I first started about two years ago.
    I’m still in the habit of doing some bad decisions with coding.

    • http://www.seansteezy.com sean steezy

      yeah i hear that. as not going to school for this stuff you miss out on the fundamentals

  • http://www.Chromand.com Glenn

    Great article! I would have never thought about using h6 tags the way you recommended.

    However, I don’t know if compressing files is always a good idea, it sounds like it would make debugging sites and changing your work later a lot more difficult. Most coding projects are never ‘complete’ one day you just stop working on them.

    • patrick

      i have a method that seems to work: i compress my css files, in part because i do consider it a best practice, but also because my css files are chock-full of comments, white space, and indexes (at the beginning). but before i compress the final css files, i copy them as .txt files. when i deploy the site i upload those .txt file(s) outside of the root folder so it (or they) isn’t served. trust me, my css comments are extensive, and i do this for me and for anyone who updates the site in the future. but compression is mandatory in all of my projects.

  • http://www.pixoliacreative.com(underconstruction) Ray

    Great Tut!

  • http://www.twitter.com/timothymarshall Timothy

    Validity is overrated. For example, if you use target=”_blank” it won’t validate. Which doesn’t make too much sense.

    Not to say that you shouldn’t care about the quality of your markup. Unlike most programming languages when you use any code (JS, HTML, etc) on a website browsers do their best to make sense of them. This means that they are generous and will try to make bad code work. So a lot of developers write sloppy, poor code but it works in a handful of browsers. So do make sure that all is well. Validation is a way to prove it, but even if you write everything correctly you may need to use some valid features that will not validate due to poor standards.

    • http://www.springbud.co.uk Shaun

      Actually, it makes lots of sense. Forcing users to open new windows is not only aggravating, but is a big problem for accessibility too.

      I suggest you take a look at this Dive Into Accessibility article: http://diveintoaccessibility.org/day_16_not_opening_new_windows.html

    • http://www.friskdesign.com Matt Hill

      target=”_blank” is perfectly valid if you use the right Doctype. I think what you mean is that it’s not valid for the XHTML Strict Doctype.

      If you need to use target=”_blank”, then simply switch to the transitional Doctype.

      There are no “best” doctypes that people should use, you should just use what’s appropriate for the project. Correct use of the correct tags for a given Doctype will yield correct validation.

      I do agree however that validation in and of itself is not the be-all and end-all of a good website build.

      • http://www.e-sushi.net/ Mike Edward Moras (e-sushi™)

        _blank is “accepted” but depreciated by the W3C, It will fade out.

  • http://www.balkhsi.com Syed Balkhi

    This should be named not just for beginners, but for all webmasters and designers. Very nice article, just dugg and retweeted.

  • pedropenduko

    Very well done!

  • http://gustavobarbosa.com.br Gustavo Barbosa

    Congratulations, this article is great.

  • http://www.mikedaleo.com Michael

    Fantastic article.

    Along with #24, I would add learn about basic visual design principals (color theory, contrast, light and shadow etc.) and how to execute them.

    Photoshop is clearly a must, especially if you are a solo freelancer.

    Personally, I took a weird learning route: Flash–>Photoshop–>HTML–>CSS

  • Tracepoint

    Timothy,

    You’re not wrong but you agree that you need to know the rules and know them well before you know when it is appropriate to break them?

  • http://twitter.com/saurabhshah saurabh shah

    this is an amazing post jeff ! thanx for sharing it …

  • http://nikhilmisal.wordpress.com Nikhil

    Great Post,

    Every point is notable and excellent.

  • http://www.troypeterson.com Troy

    Great article!
    One thing that you should add as well is to include title tags on all links, especially image based links, for SEO purposes.

    • http://www.troypeterson.com Troy

      Sorry… missed it.
      You might have to spell it out :)

  • http://www.jeff-way.com Jeffrey Way
    Author

    I’m starting to feel that you guys don’t appreciate the corn references.

    • Mohammad

      LOL
      Seems like you did an extra effort providing those corn facts.
      Appreciated fun.

      • Meshach

        I loved it Jeffrey.

        You’ve got a great sense of humor. :)

  • JorgeRB

    Very useful article for a “newb” like me. You do great work. Keep it coming.

  • Phil

    Great article Jeff, I liked number 20 as I can fully relate to where you are coming from.The great feeling from getting those bugs ironed out never fades for me.

  • http://www.tylerdiaz.com/ Tyler Diaz

    I enjoyed the read – Just the post title should be altered to something like “30 Development best practices” as this posts covers more topics than just HTML as the title states. Great post , keep up the good work.

    +1 subscriber

    • http://www.e-sushi.net/ Mike Edward Moras (e-sushi™)

      Yep – Photoshop relates to HTML like a fish to a car. It can fit, but it will never match. ;)

  • http://www.mariomelchor.com Mario

    Great. Love The CSS Reset. I should really start using it to stop those headaches.

  • Drazen

    I am always serious a and honest when writing a comment. I enjoyed this Tutorial really!

    Its real fun reading this even for someone how is developing for more than 2,5 years (like me).

    Thanks Jeffrey! Now i am a little bit sorry what i wrote in the previous Round-Up but it was honest :)

  • Kyle

    Great work Jeff! Always good to see some beginner stuff

  • http://www.thatgraphicguy.com ryan

    Great Read…

    I know photoshop backwards, forwards, up, down and even standing on my head… but for the life of me I absolutly hate using it to build a website. I user Illustrator… Am i crazy? (i do use photoshop for the normal image work and small part of the design, but than move it into Illustrator to line it all up and create the page/site.)

    • Drazen

      Thats kickass, i never ever heared someone using Illustrator for Webdesign xD

      I know people using Fireworks instead of Photoshop. You could make a Tutorial “Build a Website with Illustrator” =)

      • Callum

        Illustrator’s a lot better for the general layout of image-based designs. You can create boxes to specific dimensions, and do a lot of what Photoshop does (minus bitmap-oriented features). In fact I would honestly suggest producing images in Photoshop and laying them out with Illustrator. Pixel preview’s a great feature for refining the design, as well. People underestimate Illustrator!

      • http://www.seansteezy.com sean steezy

        yeah i am actually doing that for mine, though some things are a lot harder to do in illustrator then photoshop but it has it’s advantages. but yeah, callum is right, making a specific sized box is a one click process, but good luck trying to fill it with a pattern…

        go illustrator

      • Paul

        I just wanted to point out that you can created specific sized boxes in Photoshop too.

        Select the Rectangular Marquee tool (M) and select “Fixed Size” under the styles box.

        Image:
        http://i39.tinypic.com/b7gmmh.jpg

    • http://www.sosfactory.com Sergio Ordoñez

      I think just depends on the kind of website you are designing, if its a clean corporative site Illustrator could be useful, for graphics oriented sites I still prefer Photoshop because by itself can do the whole work (layout and graphic edition) while Illustrator dont.

      But I guess its just a personal prefferences :)

  • http://www.venuepath.com Sam G. Daniel

    Thanks for the tip on YSlow. Great tool to check the conditions on a site. Learning Photoshop is a must for any web developer now a days. Has come in handy for several projects.

  • http://www.reycode.com Michael Rice

    This is a fantastic post. Really, this is epic and a must-read for beginners.

  • http://www.graphicom.ca Idowebdesign

    Regarding “Never Use Inline Styles”

    “It’s like crossing the streams in Ghostbusters. It’s just not a good idea. ”

    But crossing the streams did actually killed the beast at the end of the movie :)

    • http://www.jeff-way.com Jeffrey Way
      Author

      Then tell that to Chris.

    • Dan

      Which is why that one should be “Only Use Inline Styles If You Have A Really Good Reason.”

  • http://www.webhostdesignpost.com Cody

    Nice List!! Lots of useful practices for anyone really.

  • http://sneakybadger.com Jason Kempshall

    Very nice, just wish i had this a few years ago :)

  • http://blog.bogojoker.com Joseph Pecoraro

    Great article. I’ll try to add a little to it.

    “10: Keep Your Tag Names Lowercase”

    This also helps when compressing your content and sending it over the wire (gzip/deflate). Compression works by more efficiently representing repeated content. Since lowercase letters are far more common then capital letters, and because html tags represent a noticeable chunk of any html document you’re likely to see a small improvement in compression if you use lowercase letters for html tags. Its not just convention, its common sense!

  • http://www.bin-co.com/blog/ Binny V A

    I would add one more – Get an experienced web dev to review your code – you could learn a lot that way.

  • Wallison

    Show post! Thanks for the contribution.

  • Norman

    I have been reading nettus for over a year now and I would have to say that is the most awesome article I have read. For me I can’t get enough of getting the basics right. Many thanks.

  • Jack F

    You forgot Komodo Edit as a free Windows/Mac/Linux editor, it’s my favourite! Nice round up.

  • http://www.terencemstone.com Terence M. Stone

    Great must haves. Who is the moron who says Photoshop has no place in Web Development? After Photshop, HTML and CSS learn Flash basics.

  • http://www.v8webdesign.com Deh

    Great article for beginners.

    Just one thing about item: 5: Consider Placing Javascript Files at the Bottom

    If i place my .js files outside the “head” tag, my xhtml wont be valid.

    So, item 7: Validate Continuously, won’t be possible.

    Thanks and congratulations.

    • http://www.joestrong.co.uk Joe

      It’s perfectly valid to put js files outside the head tag. Either inside the head or body is fine.

      • Jon E

        I was under the impression that it would not be valid too, but i just ran a check with w3c validator and it does, indeed, validate fine.

  • http://jarodtaylor.com Jarod

    This article would’ve helped me tremendously back in ‘nam when I was noobin’ it. Good job, Jeff.

  • Alexandre HOCHART

    Stay up Late … and drink expressos !

  • http://www.cjroebuck.com cjroebuck

    Hey, this is my first post on nettuts, i’ve been following for quite a while now and just like to say a really big thanks for all the great tuts.

    Im just starting out coding my first website from scratch and one of the noob things I keep coming across and asking myself is this :- which units should you measure widths/heights in, should i use px, em or %? I never know when to use each different type of measure and what the consequences are for each. I know this is in the CSS but its still a very beginnerish question that i want to get straight before i start out!

    Thanks

  • http://www.webmuch.com Aayush

    Nice article….i kinda wish someone had told me all these when i started two years ago….I would’ve learned a lot more by now…

  • kucrut

    You’re a smallville lover Jeff?
    Nicely done! ;-)

    • http://www.jeff-way.com Jeffrey Way
      Author

      Nope. Never watched the show.

  • pandu

    love your tutorials, thanks jeff

  • Jordan

    Everyone always leaves out jEdit from their list of editors.

    It’s by far my favorite.

    Great list!

  • Dynamitesoul

    This is a great article however as I am a newbie in web development, can someone please point me in the direction of finding a good CSS coding technique and how to use the right tags. With regards to the naming convention, what are the common ID selectors when designing a web site (i.e #wrapper, #container)? I get confused when to use them as opposed to classes.

    • http://www.johnwright.me john

      an #id is meant to be used only once per page while a .class can be used numerous times. you can learn a lot from Chris over at (www.css-tricks.com)

  • http://chrisberthe.com/ chrisberthe

    Man-o-man, nice one Jeff.

  • Art

    Very nice, this will sure help me focus on the things to practice most while I learn html and such.

  • http://threepixeldrift.co.cc Taylor Satula

    I feel like a n00b but ive been doing css for years now and still am not good with frameworks, i havent really looked into them though

    • Rory

      Most of them are based of float positioning. They are extremely easy to learn. I don’t know where the author was going saying they’re for experienced developers only (even though I am)

  • Robert

    Visual Studio Web Developer Express (free) is a great tool for web design. It actually does stuff better than Dreamweaver. It’s also a great choice for PC users, although I still use Dreamweaver sometimes too.

    • Vicente Obregon

      Visual Studio Web Developer Express: Maybe the greatest, it works to create, edit and debug javascript. Ubunteros, an option to that (debugging javascript)?

  • Andrew

    WOW Jeff…Another great one

    #24 however, there are some of us that live in the open source world and would prefer GIMP instead.

    But i think we get your point.

  • http://www.l4u.dk lau

    Pretty basic, nice check list tho. I dont agree with you on everything, but it’s a nice list.

    • http://www.jeff-way.com Jeffrey Way
      Author

      Which things don’t you agree with? They’re all correct.

      • w1sh

        Yeah bitch!

        Don’t make Jeffrey “The Wrong” Way whoop yo ass!

      • http://www.l4u.dk Lau

        fx the h1 on all article-titles.

        In SEO i believe it’s best to keep a maximum of h1 per page.
        If you have a blog you’d probably have 10 articles on the frontpage with 10 h1-tags – one fore each article. Thats where i dont agree with you.

        Personally i would always recommend h2 for article-titles if you show more than 1 article per page (which almost everybody does on the frontpage).

      • http://www.l4u.dk Lau

        Typ0..
        “In SEO i believe it’s best to keep a maximum of one h1 per page.”

      • http://www.jeff-way.com Jeffrey Way
        Author

        I agree with that. On the main page, place those headings within h2 tags. But then, on the main posting page, change it to h1.

      • http://www.e-sushi.net/ Mike Edward Moras (e-sushi™)

        If you would read a Doctype specification document issued by the W3C every now and then, you would have to bite your tongue for saying that. 80% of your post is incorrect and it’s certainly not a list of “best practices” that would enable you to survive the web-dev industry.

        At least you ego seems to be working… ;)

      • http://www.jeffrey-way.com Jeffrey Way
        Author

        Mike – the post is a bit dated, but 80% is incorrect? haha – okay.

  • Chesham

    Very good informative article. A lot of these I do, but there are a few I’m currently not doing and will have to look into.

    I like the css reset tip. I started using a reset around a year ago and it really helped me a lot. It’s a lot easier to style something when there’s no extra styles from the browser. So yeah, I highly recommend at least looking into them, they definitely saved me a lot of headaches.