5 HTML Tips to Create a Fast Loading Free Website

Ads by Google

My HyperText Markup Language (HTML) skills are rusty for certain, but perhaps that qualifies me for this article. Back in the day when Friends was still on TV and AOL was sending out free coasters and mini-frisbees daily, I was creating websites to load on dial-up modems. As time went on, I had the nerve to think that there are plenty of people still out there with non-broadband (dial-up) connections and continued to design web sites based on that.

Finally, I gave up web design and development when quality of content started to get pushed to the side by quantity of content. Flash sites, lots of images, pop-ups, pop-unders, sliders, etc. Trust your quality content and you don’t need this fluff. Trust your content and you can make your website blazingly fast.

With a website that is hosted on a free service, faster is definitely better. Why? Because ‘free’ tends to attract a lot of people and the server has to dish out your page plus thousands of other peoples’ pages that aren’t optimized. It’s like trying to pass a convoy of Kenworths pullin’ logs with your Jimmy haulin’ hogs. But if you have a small Porsche, that gets a lot easier to do.

Here are some tips to trim the fat, in no particular order.

1. Use Tables Sparingly

Tables are a catch-22. In the beginning, they were used to lay out design as well as put content into table format. As the design layouts got more complex, the tables got bigger and nested deeper, and that always means a slow down on load time.

Cascading Style Sheets (CSS) came along and really helped the problem of using tables for layout. Unfortunately, the browser makers couldn’t seem to wrap their heads around the idea of standards – and still can’t. What looked great in CSS in Firefox looked like a dog’s breakfast in IE and possibly didn’t even render in Safari. Don’t get me started on IE5 on a Mac. I’m still in therapy over that.

Ads by Google

Please only use tables to layout content that must be in a tabular format – like a price list or hockey stats. That reduces the number of tables, and depth of nesting, which means speedier load times. Learning CSS will make a big difference, if you must have a fancy layout.

2. Use HTML to Create Colour

Yep, I’m Canadian, so it is colour with a ‘u’ to me. I know HTML is America-centric so the attribute is ‘color’. Learn your hexidecimal color codes and use them to to liven up content instead of images.

Try adding the color attribute to your HTML elements to spice it up. This works especially well in tables, or the body tag, like such:

<body bgcolor=”#FF00FF”>

If you were a browser, would you be faster at loading a simple 7 characters of #FF00FF or a 10×10 pixel image of the colour fuschia a few thousand times? That’s a rhetorical question, you in the back row. Put your hand down.

3. Link To Scripts/Style Sheets

If you use a certain JavaScript (JS) or CSS repeatedly throughout your website, think about creating their own file and calling it, instead of putting it on every page. Since a browser tends to cache a file and call that file first before checking with the server, your browser will already have that script or CSS ready to use. That means less HyperText Transfer Protocol (HTTP) calls which means a faster loading page.

How to Call an External JavaScript:

<!–
<SCRIPT SRC=”my_script.js”>
</SCRIPT>
–>

Why did I put those comment tags around the call for the JavaScript? Because not every browser is set to read scripts. Adding the comment tags makes the browsers with scripting disabled just skip over it, instead of giving annoying error messages.

How to Call an External Cascading Style Sheet:

<link href=”my_style_sheet.css” rel=”stylesheet” type=”text/css”>

It’s that simple. The attribute href is where you set the location of your style sheet. The rest of the attributes tell the browser what that file is, so it knows what to do with it.

Some developers may use the @import method to call a stylesheet. In Internet Explorer, this is like having your <link> tag at the bottom of your file, causing it to load the whole page and THEN render the styles on it. Not good.

4. Combine Your Commonly Used Scripts in One File

Many web developers will use the same scripts over and over again. Perhaps there’s a clock script and a calendar script and maybe some sort of special effect script that they’ll use on every page. Instead of having 3 separate files, with 3 separate HTTP calls, put the scripts in one file and call it once. That cuts your HTTP calls by 66% and it gets cached as well. You speed demon, you! Before you raise your hand again, yes, you can do the same thing with CSS files.

5. Do Not Use HTML to Change the Size of Your Images

If you want to use an image that is 1000×1000 pixels on your web page, but you want it to be only 250×250 pixels, change it in an image editor. Some people will ‘shrink’ the image using HTML like such:

<img src=”BigPicture.jpg” height=”250″ width=”250″>

If that 1000×1000 pixel image is 2 MB in file size, resizing it with HTML doesn’t make the file size any smaller! In fact it may take longer to load, because now the browser has to put 10 pounds of poop in a 2 pound bag, so to speak. Not an easy task.

Hopefully these tips will help you. Give me a shoutback in the comments if you use them or have some other HTML optimizing ideas to share.

<link href=”myCSS.css” rel=”stylesheet” type=”text/css”>
Join live MakeUseOf Groups on Grouvi App Join live Groups on Grouvi
Graphic Design
Graphic Design
31 Members
Ads by Google
Comments (33)
  • Robin

    FYI, bgcolor is a deprecated attribute, so it’s better to avoid that.

  • ACheapChick

    Thanks for the tips. I’m less than an amateur at this. I started my blog 4 months ago and used a template but hated the load time so I started at square one and created my own thing about a month ago. Since I’m still learning the basics, tips like these help a lot.

    I can use all the help I can get. :)

  • Peter

    Well that’s just me being very English when the man in Canterbury out of ignorance says it isn’t so. :-)

    As to code maintenance, I used to have a departure area system; prior to FTP I’d copy the stuff to the appropriate sub directory, then crunch it and perform any other operations (gifs and stuff), fire up WSFTP_Pro, and that was the job done.

    Well written? It’s nice to know that all of the letters after my name shine through, but I don’t consider myself to be a html expert.

    I’ve not had a site for about 10 years. :-0

    I read your remarks about css with a little discomfort. You see I’ve a put together a few css friendly html editors. Oops. I will never use notepad. :-)

  • Tobey

    Hehe, nice tips served in an amusing manner. Thx

  • Peter

    It was probably unfair of me to be so harsh without supplying links, so here they are. Downloads for compressors:

    http://www.alentum.com/ahc/
    http://www.softplatz.com/Soft/Network-Internet/Other/Optimize-GUITIDY.html
    http://aciddrop.com/php-speedy/
    http://www.brothersoft.com/lightspeed-website-optimizer-21016.html

    Online compressors:

    http://fixmyhtml.com/
    http://wordoff.org/

    And no, I do not believe in doing HTML code using an ascii text editor. There are some things where purism is more than dubious.

Load 10 more
Affiliate Disclamer

This review may contain affiliate links, which pays us a small compensation if you do decide to make a purchase based on our recommendation. Our judgement is in no way biased, and our recommendations are always based on the merits of the items.

For more details, please read our disclosure.
Affiliate Disclamer

This review may contain affiliate links, which pays us a small compensation if you do decide to make a purchase based on our recommendation. Our judgement is in no way biased, and our recommendations are always based on the merits of the items.

For more details, please read our disclosure.