From the category archives:

General

Hints All the Way.

by Jeff on November 24, 2005

One of the best ways to make your site easier to use is to provide hints to your visitors everywhere you can. You might think that sounds simple enough, but the amount of time required to do it and the number of things to consider puts a lot of web designers off.

Visitors Don’t Know Your Site.

You have to consider that the overwhelming majority of your site’s visitors are likely to be visiting for the first time some of them may be loyal visitors, coming back over and over again, but the modern web lends itself more to being dipped in and out of using search engines and links from other sites. If there’s some kind of process visitors need to go through to accomplish something on your site, you can’t assume that they have any familiarity with it at all.

For this reason, it’s important to scatter hints across your site. Whenever there’s something that could seem mysterious if you hadn’t used it before, hints should either appear automatically or be easily accessible, in case the user needs to know what to do.

Question Mark Icons.

One of the easiest ways of doing this is to put question mark icons next to things that you think might be confusing. For example, at a website that lets people pay their water bill, I saw this:

Register for Online Billing
First name: ____
Last name: ____
Account no.: ____ [?]

Notice the question mark next to the input box for account number this was provided because, of course, not every customer is likely to know their account number by heart, or where to find it. Clicking the question mark popped up an image of a paper water bill, with an arrow pointing to where the account number could be found. Unless you want customers to wonder ‘what account number?’, that’s the best way of doing things.

Alt Text.

Alt text is the contents of your images’ alt tags that is, text you put in your image tags’ alt properties, like this:

The main purpose of this text is to provide an alternative form of display for browsers that don’t support images, and blind users. However, it also has another purpose: as ‘tooltips’, to provide hints. If you have a small icon of a printer, for example, and clicking it causes the current article to change to its print CSS and then print, then you make make the alt text look like this:

Now, when users hover over the printer icon, the text “print this article” will appear as a tooltip that is, black text in a yellow rectangle. This is useful for letting users know what will happen when they click parts of your site, without having to have text next to everything especially good if you’re limited for space, or you expect lots of people to use your site from mobile devices like phone and PDA browsers.

Javascript.

Finally, one of the best ways to make your hints context-sensitive is to use Javascript. Not only can you enhance the alt text boxes to look nicer with Javascript, but you can also display hints entirely automatically. For example, you might have a form that asks for someone’s state and date of birth:

State: _____
Date of Birth: _____

Using Javascript’s onfocus event, you can easily write a little code to not only highlight the box the visitor is currently typing into, but also provide a hint next to it so when I’m typing my state, the hint can say ‘two letters is fine just CA or NY’, and when I’m typing my date of birth the hint says ‘dd/mm/yyyy’.

What does this approach achieve? Well, it lets you provide hints when they’re needed, without having to clutter the page with them or put them in small, faded text that makes them hard to see. Making your site sensitive to context when it comes to helping the user get things done is one of the big keys to better usability.

If you enjoyed this post, make sure you subscribe to my RSS feed!

{ 0 comments }

FrontPage: Easy Pages.

by Jeff on November 23, 2005

One way to create web pages from scratch without using HTML is to use an editor that hides the HTML from you, letting you edit a web page as easily as you would use a word processor. These programs are called WYSIWYG (What You See is What You Get) editors.

Microsoft’s FrontPage is one of the most popular WYSIWYG editors, mainly because it comes as part of Microsoft Office, which lots of people buy just to get Word and Excel. FrontPage is, therefore, seen as a cheap and easy solution, and the fact that it works very similarly to the other Microsoft Office programs is a plus as well.

Using FrontPage.

FrontPage is very easy to get started with: you can either create a single page, or a whole ‘web’ (FrontPage’s word for a set of inter-connected pages). You can use the buttons on the toolbar to do simple things like set your text’s font, make text bold and italic, make links and insert graphics.

Going up to the menus will give you access to a few more complicated functions, such as table creation. Part of the reason FrontPage is so popular is that it has all sorts of little scripts ready to insert into your page, including hit counters and animations.

FrontPage Extensions.

FrontPage is quite unique in that many web hosts have special ‘FrontPage Extensions’ installed, that allow to upload your site easily from FrontPage to your host. In most cases, though, you’ll be better off just saving the files using FTP. You will also need to have the Extensions installed on your server if you want the forms FrontPage produces to work, or if you want to be able to add its search function to your site.

Really, the Extensions are nothing more than a good reason not to use FrontPage to design any dynamic elements of your site it will cause you no end of trouble. FrontPage is only really any good when it comes to designing static pages.

FrontPage Templates.

One of FrontPage’s strong points, however, is that it has an easy-to-use templating system. This means that you can download templates and easily use them to create new pages in FrontPage. It will create a navigation system for you as you go, using information from the template. This can be a quick and easy way to get started on your website, although you’ll often need to be careful to avoid doing anything that causes the carefully worked-out layout of the template to break.

Problems with FrontPage.

FrontPage’s biggest problem is that it produces wildly non-standard ‘Microsoft HTML’. This HTML is bad enough to be completely un-editable by anyone who isn’t also using FrontPage, and has a tendency to display wrongly in any browser apart from Internet Explorer. Even the default template you see before you’ve typed a word in FrontPage isn’t valid HTML!

Worse, because e of the amount of repetition FrontPage introduces into your pages, they can often be much larger than they need to be and so take much longer for your visitors to download than they should. It’s bad enough that many sites offer programs designed specifically to do nothing but clean up FrontPage’s terrible code.

Part of the reason there’s quite a stigma attached to FrontPage amongst web users is that it tends to produce pages that are extremely amateurish. Some FrontPage sites can even crash web browsers, because their authors decided to use FrontPage’s various animated navigation elements FrontPage is all too happy to quickly add in so much Javascript and Java that a website becomes unmanageable. Page transitions are particularly bad.

Overall, trying to create and manage a website with FrontPage can be a big headache it’s all too easy to hit one of FrontPage’s bugs and mess something up, or load it with too many proprietary features to the point where it’s pretty much unusable to anyone. Worse, if you open a half-finished web page in FrontPage, its code will be messed up beyond repair.

If you enjoyed this post, make sure you subscribe to my RSS feed!

{ 0 comments }

Free Graphics Alternatives.

by Jeff on November 22, 2005

With Paint Shop Pro, Photoshop and most other popular image editors being commercial, paid-for software, you might be forgiven for thinking that there aren’t any free alternatives. While they’re not very well publicised, there are plenty of free graphic editing alternatives out there, if you know where to look. Here’s a rundown of some of the best.

The Gimp.

Despite its daft name, the Gimp is widely considered to be the best graphics editor you can get for free many devotees compare its features to those of Photoshop. While it isn’t easy to use as most commercial offerings, the Gimp is certainly powerful, and has become the most popular image editor for Linux (which doesn’t run Photoshop).

The Gimp (or GIMP, standing for GNU Image Manipulation Program) was specifically designed to be an open source competitor to Photoshop, in much the same way as OpenOffice.org competes with Microsoft Office and the Mozilla browsers compete with Internet Explorer.

However, Gimp still hasn’t picked up much of a following outside the open source community, mainly because of its unusual interface. Gimp is based on the Linux GTK (Gimp Toolkit) system, and that makes its interface look very un-Windows-like, since it is broken down into small, separate components. This approach does come with advantages, however, such as the Gimp’s useful ability to let you ‘rip’ menus and sub-menus away from where they usually appear and use them as toolbars instead. If you haven’t had time to get used to Photoshop, you might even find that you prefer the Gimp’s interface.

In some areas, the Gimp outshines Photoshop by a long way. For example, Photoshop comes with a rather limited selection of filters, and there are plenty of companies who make a business out of selling extra ones at a premium. The Gimp includes every filter that the open source community has ever found useful, which is quite a few, and they all come for free. Essentially, if you’re willing to take a small hit in ease of use, the Gimp provides you with thousands of dollars worth of functionality at no cost whatsoever.

If you want to download the Gimp, go to gimp-win.sourceforge.net/ to get the Windows installer version. There is also a version that has been customised to have a more Photoshop-like interface you can get it at www.plasticbugs.com.

Paint.NET.

Paint.NET is a recent arrival in the open source graphics world, but has gained a lot of followers in the year or so it’s been around. It offers a powerful graphics editing program with a deliberately simple interface, based on the ‘Paint’ program that comes with Windows the fact that people already know how to use that interface has been an important factor in its popularity.

The program’s development is taking place at Washington University, and is supported by Microsoft, making it likely that it might be included in future Windows releases. Paint.NET can currently be downloaded for free from www.eecs.wsu.edu/paint.net.

SodiPodi.

SodiPodi isn’t really an alternative to Photoshop or Paint Shop Pro it’s more like a free version of programs like Macromedia Freehand or Adobe Illustrator that graphics designers wouldn’t usually use often enough to justify purchasing. It lets you draw using vector graphics, giving you the useful ability to create your own artwork instead of sticking with stock symbols. This is mainly worth mentioning here because it makes a great complement to tools like the Gimp and Paint.NET, letting you make something of your own to apply all your fancy effects and filters to when you’re making a logo or a design.

You can get SodiPodi at www.sodipodi.com, although you might also like to look at another version named Inkscape (www.inkscape.org), which again has a more Photoshop-like interface.

Picasa.

Finally, if all you want to do is organise photos simply and get them ready for display on the web, you could do worse than Picasa. Recently bought by Google and made available for free at www.picasa.com, Picasa makes it simple to organise your photographs and apply simple effects like red-eye removal to them.

If you enjoyed this post, make sure you subscribe to my RSS feed!

{ 0 comments }

Focus on the User: Task-Oriented Websites.

by Jeff on November 21, 2005

There are, broadly speaking, two kinds of websites: ones where visitors come to be informed and entertained, and ones where users come to get things done. The second kind of website usually provides some kind of interactive service, which could be anything from letting people upload pictures to giving them a form to contact technical support representatives. Whatever your site is there to do, though, you need to make sure that it focuses on it. In other words, your website needs to be task-oriented.

The Big Mistake.

Let’s say I was going to that picture upload site. What the site lets me do is upload pictures to the web, and then send the link to my friends so that they can see my pictures. Simple enough, right? The site explains the concept simply enough, has an FAQ on the kinds of pictures it can allow, a bit about the company offering the service, an offer to subscribe to a premium version of the service…

Well, that’s great and all, but where do I upload my pictures? Of course, it turns out that I just happened to miss the tiny ‘Upload Now!’ link at the bottom of the page. The chances are I’m not the only one. I came to this website to perform a task, and the website didn’t make it easy for me because it wasn’t at all task-oriented.

So how should things have worked? Well, really, the very first thing on the site should have been a very short blurb about what it did two sentences maximum followed by a box that allows me to find my picture and a button marked ‘upload’. Why make me go through to a new page when I could do it right here? Why tell me a load of things I don’t need to know before letting me upload a picture? Everything else can still be there, but it’s not the focus: the focus is on getting the task done.

Taking it Further.

Of course, that was a relatively simple example, but you get the point. Let’s say I’m going to the technical support website now. Let’s think about this logically: why would I be doing that? The chances are it’s because I have a problem that I want technical support to help me with! In this situation, I don’t want to read a page about your technical support being industry-leading and great value I just want to get my problem across. Pictures of smiling models pretending they work in technical support are particularly likely to annoy me.

How should this website work? Ideally, it should first of all offer the phone number, in large text. Many people will prefer to phone, especially the elderly, and just came to the site to find the number. Next, there should be a set of options like this:

Welcome to technical support. What are you having a problem with?

Mouse
Keyboard
Hard disk
CD drive
Something else

Each option links through to another page, asking the next question you would ask. This immediately lets you narrow down the possible problems it’s a far better solution than sticking up a big ‘knowledge base’ and letting people search through it to solve their own problem. These ‘expert systems’ will save you a lot of time when it comes to supporting anything, if you deploy them correctly.

A Question of Language.

In many cases, changing your site to be more task-oriented isn’t really a question of redesigning it’s all in the language. For example, I recently saw an email website go from this navigation:

Log in
Register
FAQ

to this:

Check my email
Get an email account
About us

Writing ‘check my email’ is a hundred times better than writing ‘log in’, because it matches up with what the user is actually there to do. Especially for complicated company website, it’s great to have a quick ‘task list’ stuck up there in a corner. People may just want to sign up for whatever you offer without reading the site, or contact you, or maybe just let you know that their details have changed in some way. Whatever, it’s a great courtesy to make all the interactive elements of your site easily accessible, as well as mixing them in with the information.

If you enjoyed this post, make sure you subscribe to my RSS feed!

{ 0 comments }

Dreamweaver: The Professional Touch.

by Jeff on November 20, 2005

Dreamweaver is sometimes seen as FrontPage’s main competitor but, really, there’s not even a comparison to be made. Dreamweaver might be expensive, sure, but there are serious web designers out there using it and getting work done I can guarantee you that no real designer has ever used a copy of FrontPage to design a website. Consequently, Dreamweaver is way out in the lead in terms of market share, with about 80% of the users.

So what do you sacrifice to get a better WYSIWYG editor? Well, apart from the higher price tag, you also sacrifice a certain amount of simplicity. Once you get used to it, though, Dreamweaver isn’t as hard to use as you might think.

From the People Who Brought You…

Dreamweaver is part of the Macromedia Studio that’s the company that produces the editor and player for Flash, as well as the well-liked Fireworks graphics editor and the Freehand drawing program. Their software is particularly popular with designers, and all it works on the Mac, but it has recently started to be quickly adopted by non-expert users as well.

Dreamweaver Doesn’t Mess With Your Code.

If you’ve already done some of the coding for your site, or you’re editing a template or a design that was done for you by someone else, then you don’t need to worry about Dreamweaver re-writing all your code and breaking it. Dreamweaver will leave your code alone for the most part, unless you explicitly tell it to alter it. This might not sound like much, but it’s really refreshing to see after using other HTML editors.

For this reason, Dreamweaver is often considered to be the very best software out there for working with HTML templates, and most templates that you can buy will be provided to you in Dreamweaver’s format. Once you’ve got them, you can easily open them and insert your content.

Standards.

The code Dreamweaver used to produce was quite bad at conforming to standards it worked fine on most browsers, but it didn’t validate. In the most recent versions of Dreamweaver, though, not only does the code Dreamweaver produces validate, but it even has a validator built in. You can pick which standards you want Dreamweaver to code to, and it will stick to them for you, even if you choose the strictest ones out there.

Dreamweaver was one of the first programs to support visual XHTML editing, and has received a lot of credit for it all you need to do to turn this option on is tick the box marked ‘Make Document XHTML Compliant’ when you create a new page. This newfound standards-compliance removed the last thing keeping a lot of designers away from Dreamweaver, which means that the program’s market share has grown still further over the last year or so.

CSS, Javascript and PHP.

A large part of Dreamweaver’s power comes in how easy it is to edit not only HTML, but also the things that go with it. Dreamweaver comes with a formidable Javascript library that does most of the useful things that can be done with Javascript, and makes it very easy to apply CSS styles to different parts of your page.

In the latest version of Dreamweaver, you can even make interfaces to a MySQL database using PHP without doing any programming at all. This is a very useful feature, and saves a lot of headaches for many people who just want to make a simple database-driven website without learning PHP.

Books About Dreamweaver.

Dreamweaver is a complex and useful enough program that whole books have been written about it and to get the most out of the program, you should really get a good one and read it through. Here are a few suggestions:

Macromedia Dreamweaver MX 2004: Training from the Source - Khristine Page. This is the official guide produced by Macromedia.

Beginning Dreamweaver MX - Imar Spaanjaars. Follows the development of three very different websites using Dreamweaver, a nice format for a tutorial book.

Visual QuickStart Guides: Macromedia Dreamweaver MX - J. Tarin Towers. A nice reference that’s especially good to refer back to when you need to know how to do something specific.

If you enjoyed this post, make sure you subscribe to my RSS feed!

{ 0 comments }

Don’t Be Scared, It’s Only Code: HTML for Beginners.

by Jeff on November 19, 2005

For some reason, HTML seems to really frighten a lot of people. Some have seen complicated HMTL that’s been produced by an editor program, or they’ve clicked ‘View Source’ on a few pages and been scared by what they’ve seen.

What you have to realise, though, is that HTML was designed from the beginning to be a very simple language to learn and to use just because automated systems for producing it have a tendency to make it over-complicated, it doesn’t mean that your code has to be that way. The best way to get started with HTML is to get over any fears you might have and just get stuck in.

Note that you will need to save files as filename.html before you will be able to open them in a web browser. If you’re not sure how to do this with a text editor, use an HTML code editing program.

All About Tags.

There’s only one thing you really need to understand before you start writing pages in HTML, and that’s the tag system. Basically, tags are commands in angle brackets, with text between them. For example, here is some text in a bold tag:

bold text

The second tag has a slash before its name because it’s a closing tag. You can have as many tags inside other tags as you want, as long as you always remember to close the last one first. For example:

bold, italic, underlined text

If the tags are closed in the wrong order, then the code is invalid.

The only other thing you really need to understand about tags is that they can include some extra information in the opening tag. A link tag, for example, will include an ‘href’ (the URL it links to), like this: . Closing tags never contain any extra information.

The Structure of an HTML Document.

These tags are usually laid out in a certain order. HTML is quite flexible in general, but there are two tags that almost all documents need to have: the head and the body. The head should contain information about the document, as well as any scripts or stylesheets it uses, while the body should contain the main text of the document. So, as an example, a simple HTML document might look like this:

my page
body { background-color: blue; }

some text

The first thing to notice is the way it starts and ends: with the HTML tag. This is essential when you write HTML. Now, notice what’s included in the head and what’s in the body: while the head tells you the title of the page and that its background colour is blue, it’s the body that has the web page’s text.

Once you’ve got that basic structure, all you need to do is add more tags to make your page.

A Guide to the Tags.

html. The first and last tag. Tells the browser that the document is HTML.

head. The header.

title. The page’s title (appears in the browser’s title bar, right at the top of your screen).

style. Contains CSS that provides information on how the browser should present your page.

body. The main body of the page.

p. A paragraph. All text should be contained in paragraph tags to start a new paragraph, close the old tag and open a new one.

b. Bold. Text between b tags becomes bold.

i. Italics.

u. Underline. Beware of using this tag for things like headings, as many users have come to expect underlined text on the web to be a link.

h. Heading. You should use different tags depending on how important your heading is, so h1 for a page’s main title, h2 for subheadings, h3 for the next headings down, and so on.

a. The link tag (the a is a little confusing: it actually stands for ‘anchor’). This tag lets you link some of your text to another page. It works by surrounding the text that you want to become a link, like this: click here.

ul/ol. Stand for ‘unordered list’ and ‘ordered list’ used to say that a list follows. The only difference is that ul uses bullet points while ol uses numbers.

li. List item, a tag used inside ul or ol, like this: item 1item 2

img. Used for inserting images: .

These are the most useful tags, but for a full reference, you might like to visit www.w3schools.com/tags.

If you enjoyed this post, make sure you subscribe to my RSS feed!

{ 0 comments }

Designing for Sales.

by Jeff on November 18, 2005

One thing that lots of designers don’t seem to understand is that there’s a big difference between the kind of design you should use if you’re trying to present information (usually with ads), and the kind of design you should use if the aim of your website is to make sales. This distinction causes a lot of confusion, bad design, and, ultimately, lost sales. If you’re trying to sell, then there’s a whole other set of design principles that you need to follow.

The Headline is Everything.

If you want your website to make sales for you, then the first thing you need to pay attention to is the headline on your sales page. It needs to be large, to stand out, and to grab the visitors’ attention. It should give a clear benefit (not a feature) of your product that you think would appeal to most people. If you have a bad headline then people won’t even look at the rest of what you’ve written they’ll just press the back button.

Always Be Ready to Make the Sale.

As soon as a visitor gets to your product’s page, it should be absolutely crystal clear what they’ve got to do to buy the product. If it’s a long page, then ‘buy’ buttons should be scattered throughout. If a visitor could look at any part of your page and wonder where they have to click to buy the product, then there’s something fundamentally wrong with your website’s design.

Make Happy Customers Prominent.

On a sales page you should have a space for feedback that has been left by previous customers, whether it’s in the form of reviews or testimonials. This gives people an opportunity to read a supposedly objective view of your product, and makes them feel better about spending their money on it. Of course, this means that you need to solicit feedback from previous customers to put in that space a good way of doing this is to offer rewards for customers who contribute in this way.

Pay Attention to Payment.

You need to make sure that your payment page that is, the page where you collect credit card details is well laid out and easy to use. Doing things like making it difficult to type in a credit card number or making it confusing to choose what kind of card you have is likely to damage the customer’s confidence in you and your website. This page should be professional and standard don’t be tempted to do anything unusual with it.

Highlight Special Bonuses.

To help persuade potential customers who are on the fence about whether to buy or not to buy, you should take care to highlight any special bonuses that purchasing your product will give them. For example, a physical product might come with free delivery, and a non-physical product might come with a free ebook. Don’t go overboard and have a ridiculous number of bonuses, but do add enough to make the customer feel like they’re getting very good value for their money.

Keep It Simple.

When you’re designing a website that is going to be used to sell products, you’ve got to keep things as simple as possible on the technical side. That’s because the more complicated functions you use, the more things there are that could go wrong and stop them from buying anything from you. It’s better that people see a slightly less fancy website than that they don’t see one at all because if they don’t see your website then they won’t be doing any shopping there.

To understand the basics of how e-commerce websites work you should look at as many other websites as you can. Write down the elements that they all seem to have in common for example, shopping carts and you will gradually figure out which things are essentials and which things are just bells and whistles. Your website should leaev out everything but the essentials, but make the essential things very easy to do. That is the key so successful e-commerce design, and if you can manage it then it will be very rewarding for you and your website.

If you enjoyed this post, make sure you subscribe to my RSS feed!

{ 0 comments }

Content is King.

by Jeff on November 17, 2005

Somewhere between ever more sophisticated graphic design and more complicated CSS, many designers are starting to forget one of the ground rules of the web. This rule is arguably the most important rule to follow at all times; one that you should always keep in mind when you’re designing your site.

So what is it? It’s simple. Your visitors are at your website to get information. Content is King.

The Search-Driven Web.

Studies show that well over 90% of users now have a search engine as their homepage, and use it for around half of everything they do on the web. Unless you’re advertising your site heavily, most of your users are likely to arrive through a search engine.
However, they’re relatively unlikely to be searching for a description of your products. What are they looking for? Information. There’s a reason why the web was once referred to as the ‘information superhighway’ while some people might be actively looking to buy things, most of them are just looking for information.

Relevant Articles.

So, if you’re selling products, you need to provide articles that your potential customers are likely to want to read. The bigger the audience you can build for your articles, the more conversions you’re going to have to sales. It can’t be emphasised enough just how important your content is: if it’s badly-written, or not useful, your visitors are likely to just go back to their search results page and try another link. If you give them good information, though, you instantly create the kind of loyalty that no number of advertising dollars can buy.

What many practitioners of techniques like ’search engine optimisation’ don’t realise is this: you can’t fake good content. However many keywords you might stick into it, you’ll fool search engines, but not the visitors they bring in all you’re doing is costing yourself money in bandwidth and wasting people’s time.

No Time to Write?

The most common objection I hear when I tell people they should write great content is that they have no time to write the amounts that would be needed and, yes, writing can be very time-consuming. What you have to realise, though, is that there are plenty of ways around this, such as hiring a freelance writer to do some of the work for you, or using speech recognition software.

You might also consider buying in content from people who resell it, or even getting your users to write the content there’s nothing better than getting visitors to write their own content and then getting more visitors from search engines where people have found it. There are even sites offering content for free in exchange for a link back to them at the bottom of the article, although you should be cautious about reviewing the quality of content offered this way.

Keep it Updated.

Here’s something that many people don’t realise: it’s better to write a little occasionally than to write a lot all at once. This means that, even if you have written hundreds of articles, you should release them one by one on a regular timescale. Both visitors and search engines prefer sites that are updated often to ones that have a big pile of content dumped on them once and then aren’t touched for years.

Content Makes Money.

Nowadays, it’s once again possible to make money from good content without even having anything to sell. Plenty of businesses were based on advertising back in the dot-com boom, but ad prices eventually dipped too low for this to be sustainable. Ad prices have now recovered, however, thanks to text advertising.

You can sign up with most of the big search engines now for context-sensitive ads for your site that are chosen automatically Google AdSense runs the most popular service. This kind of advertising eliminates human ‘ad editors’ altogether, while producing ads that are targeted enough to give far better returns than they ever used to. Purely content-driven websites with ads are once again a viable revenue stream, and content is as much King as it’s ever been.

If you enjoyed this post, make sure you subscribe to my RSS feed!

{ 0 comments }

Column Designs with CSS.

by Jeff on November 16, 2005

So CSS makes layouts easier than they were with tables there’s not really much debate about that. One of the reasons many people stuck with tables for so long (and, in fact, still stick with tables to this day) is that it can be difficult to create column-based designs using CSS. Since there are so many websites that essentially consist of a middle column of content surrounded by left and right columns containing navigation and ads, this was considered to be unacceptable.

The Power of Float.

Really, though, CSS columns aren’t that difficult to produce once you understand how CSS float rules work. Float allows you to say that some parts of your content should ‘float’ next to other parts, instead of being displayed one after the next (that is, underneath each other).

Despite all the fear of column layouts in CSS, it’s quite simple. Basically, the first thing to do is to divide your content from your navigation using the div tag, like this:

Note that the divs must be in this order left, right, centre because otherwise one column might end up underneath another in a way you don’t expect. Ordering things logically as left, centre, then right, for example, will cause your right column to end up under the centre one.

Anyway, the next step is to write the CSS for those IDs you just set up. Are you ready for the CSS that’s made old-style HTML developers run in fear for about five years now? It looks like this:

#left-nav { float: left; width: 20%; }
#right-nav { float: right; width: 20%; }

Obviously you can adjust the widths depending on how wide you want your left and right columns to be (you can choose whether to set the widths as percentages or in pixels). And that’s it! You’ve set up a successful three-column layout.

Then, though, the problems come they might seem small, but they’re big enough to drive anyone who works on CSS column layouts nuts. Luckily, however, they can be solved with a little lateral thinking.

The Background Problem.

If you want your left and right columns to be have a different background colour to the centre one, you’re in for a problem. In most browsers, your columns are only considered to extend downwards as far as the text in them does, which means that the bottoms of your columns won’t line up.

What’s the way around this? The best answer is to make your columns fixed-width (meaning that you specify their width in pixels, eg. ‘width: 100px;’). Once you’ve done that, you can create one-pixel-high image that includes the colours you want for the columns, and make it the background image, tiling it using ‘background: repeat;’.

The only problem left to solve at this point is that fixed-width columns can look strange if you leave them spaced as they are. The solution is to specify a fixed width for your document’s body, and then set the left and right margins to ‘auto’ this will centre the page on the screen.

The Header and Footer Problem.

Another problem? Well, yes. If you want to display a header or footer separately from the page’s columns, CSS can give you a little trouble sure, you can add them to the middle column, but that would require you to add extra space to the navigation columns at the top, and make sure they didn’t reach down further than the main content text at the bottom. It quickly becomes painful to work with.

The solution to this lies in a little-known CSS rule called ‘clear’. The clear rule means that you don’t want anything to be floating around the tag you apply it to. It has three possible settings: left, right and both.

In this case, you want to add your header and footer before and after the other divs, like this:

Then you want to add this CSS to what you’ve got already:

header, footer { clear: both; }

That tells the browser that you don’t want anything floating on either the left or the right of your header or footer: you want them clear of everything. You might also like to add text-align: center, so they appear in the middle of the page. And that’s it! What was all the fuss about, eh?

If you enjoyed this post, make sure you subscribe to my RSS feed!

{ 0 comments }

ColdFusion: Quicker Scripting, at a Price.

by Jeff on November 15, 2005

ColdFusion is a rapid application development language for the web, developed by Macromedia. It’s not free, but many people say that it’s more important to them to have the development speed that ColdFusion offers and you can download a free ‘developer version’ to experiment with before you commit to anything.

No Need for a Test Server.

One of the nicer features of ColdFusion is that it comes with a whole application to help you write it the language. While it can be used with Apache or IIS once you’re finished, this application effectively acts as your test server while you’re writing your scripts, saving you quite a lot of trouble.

As a downside, though, ColdFusion on the web can sometimes be unreliable and slow, mainly because it runs on a Java framework. Its Java support does, however, make it capable of running on many more operating systems than it otherwise would be for most purposes, having written a page in ColdFusion is as good as having used Java for it, but much less difficult. Since ColdFusion also uses the ODBC (Open Database Connectivity) standard instead of tying itself down to one database, this gives you a lot of choices.

In other words, you’re sacrificing some of your website’s speed in exchange for more choices and compatibility, and quicker development time.

Easy to Learn.

One of the things that makes ColdFusion easy to learn is that it isn’t all that different from normal HTML: it acts more like a set of extension tags for HTML than like trying to get a programming language to do things and output HTML afterwards. This is because it was designed from scratch for the web it’s not just a normal language trying to be web-compatible.

For example, here’s some code that queries a database and writes the fields it finds to the page:

SELECT * FROM table WHERE id = ‘1′

#result.field_from_query#

You can see that the ‘cfquery’ tag is used for sending queries to a database, while the ‘cfoutput’ tag adds text to the HTML. The text surrounded by hashes (#) is a variable. How are variables defined, you wonder? Like this:

Once you get used to thinking in tags, it starts to feel quite natural: ColdFusion just feels more HTML-like than other languages do.

Despite its simplicity, though, ColdFusion is considered to compete more with languages like JSP and ASP.Net than it does with PHP.

CFScript.

Unfortunately, trying to write dynamic web pages with nothing but tags can start to feel restrictive quite quickly, especially if you want to do something complicated you end up with a hard-to-read mass of tags, reminiscent of trying to do a page’s layout with tables. To solve this problem, Macromedia introduced CFScript, a Javascript-like language that you can use by putting it between tags. If you’re already a programmer, you may find CFScript easier to work with than ‘real’ ColdFusion code.

Java.

One ColdFusion strength is that it doesn’t just run on top of Java it can also call Java classes using its createObject function and use any methods it needs to, with the results being put in ColdFusion variables. This will be very useful to you if you have existing Java code or know of Java code that you’d like to make use of you’ll get access to all the J2EE libraries as well as ColdFusion’s own. It’s this fact that has led Macromedia to market ColdFusion as “a scripting layer for J2EE”. Of course, whether or not that excites you is a matter of personal preferences.

Integration with Other Macromedia Products.

If you already design your pages in Dreamweaver, it can be good to do the scripting in ColdFusion, as you get the advantages that integration between the two gives you. You can insert ColdFusion code into Dreamweaver files quickly and easily, and you can even use its built-in editor to edit the code however you want without messing up Dreamweaver’s WYSIWYG view.

ColdFusion also integrates surprisingly well with Macromedia’s flagship product, Flash but don’t let that lead you into developing nothing but ColdFusion-scripted websites with fancy Flash interfaces, whatever you do.

If you enjoyed this post, make sure you subscribe to my RSS feed!

{ 0 comments }