Article
Practical Web Design - Fundamentals of Web Design
Page Margins
You wouldn't think that setting the margins for your Web page would be any more difficult than setting the background color or the font face, but it is. Why? It's mainly because Netscape and Internet Explorer use two different sets of commands.
Without going into detail about the various tag commands, here's a simple way to deal with the issue. In your <BODY> tag, use the following:
<BODY marginwidth="0" marginheight="0" topmargin="0"
leftmargin="0" rightmargin="0" bottommargin="0" ...>
The ellipsis at the end of the tag will include the rest of your BODY commands. If you want to add margins, change the zeros to a digit (remember, the first two commands control Netscape, and the last four control IE, so change accordingly).
Again, this isn't the most sophisticated way to handle margins (CSS provides a much better way to handle margin delineation), but it works. If you know CSS, then of course you should ignore this tip and use your style sheets to handle your margins. As always, the problem with using CSS is that older browsers don't always display style sheets correctly.
JavaScript
Remember, around 10% of Web surfers keep JavaScript disabled. Some do it for security reasons, others do it because they've become aggravated with bad scripting that slows their browser functions. It's a simple matter to supply non-JavaScript users with a non-JS page; you can do it either through a redirect script in your page or by providing a "doorway" page that gives non-JS users an alternative on which to click. If you don't choose to do this, then limit your JavaScript usage to non-essential page functions.
Easy Bookmarking
Bookmarking your page is simple enough for any visitor, but you might want to encourage the practice. Here's a nice, simple chunk of JavaScript that you can paste into your site's home page to allow visitors to bookmark your site, modified from a script provided as a freebie by The JavaScript Source:
<SCRIPT LANGUAGE="JavaScript">
function addbookmark()
{
bookmarkurl="http://www.myhomepage.com/"
bookmark title="My Home Page"
if (document. all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
</script>
Add this chunk of script to your <HEAD></HEAD> section, and add the following piece of code wherever in the body of your page you want the bookmark link to appear:
<a href="javascript:addbookmark()"><b>Bookmark
This Page</b></a>
Now your page has a nice clickable link to allow for easy bookmarking (you'll need to replace the http://www.myhomepage.com/ bit with the URL of your own site, of course). If you want to have your visitors click on a graphic, simply delete the <b>Bookmark This Page</b> snippet and replace it with a graphic using the <IMG SRC> tag.
Note: this is probably the simplest way to provide a clickable means to add your page to their Favorites, but it only works in Internet Explorer. There are more complicated scripts out there that will work in both Netscape and IE.
I strongly suggest that you not use some of the available methods to force visitors to change their home page to your site; if they want to change their home page, they'll do so. SitePoint's Matt Mickiewicz provides a neat bit of code to give them a clickable link to allow users to change their home page, reprinted below from his Innovative Marketing Ideas article:
<a class="chlnk" style="cursor:hand" HREF onClick="this.style.
behavior='url(#default#homepage)';this.setHomePage(
'http://sitepoint.com');">Click
here to make SitePoint your default homepage</a>
Note that this provides a simple link that gives the visitor the option to reset their homepage, but doesn't make the decision for them. And, as in the Favorites example above, you can replace the Click here to make SitePoint your default homepage text string with a graphic if you like. Other sites simply reset the home page without your permission, or use annoying popups that you have to click out of the way to proceed with your viewing. Definitely not something that Aunt Gracie appreciates.
Outdated Content
This may not be a design topic per se, but it's still a great way to run off your audience. Keep your content updated. For some of us, that means an update every few weeks or even months. For others, it means updating a page three or four times a day, or more. Remember, too, that there's a difference between archival content and outdated content. You want repeat visitors, so give them something new to come back for.
Copyrighting Your Site
I won't get into the topic here (I've covered some aspects of Web copyrighting in an article for Sitepoint called Daylight Robbery), but you should know that anything you create for the Web can and should be noted as being copyrighted. U.S. law copyrights whatever you create as soon as you save it to a disk or upload it to a server, but it's a very good idea to mark your materials with a copyright statement something like the following, which should ideally go at the bottom of every page you author:
Copyright 2003 Michael Tuck. All Rights Reserved.
Naturally you'll use your name, not mine, and the appropriate year of copyright. Copyright law varies from country to country, so bone up on what the laws are in your particular part of the world.
And for the JavaScript users out there, here's a nice snippet gleaned from SitePoint's own Tech Times newsletter. This automatically updates the copyright notice whenever the year changes. If the given date of first copyright isn't 1998, just change it to suit your needs.
<SCRIPT LANGUAGE="JavaScript">
document.write('Copyright © 1998-' +(new Date()).getFullYear());
</SCRIPT>