Professional and Affordable Web Design
0800 080 5401
HTML Base Tag
This is not really much of an extravaganza to get things going, but a few of the more interesting things (scripts) that will be posted here are still in their beta stages.
This first article is about probably the most undervalued of all HTML tags - the
base element. The base element could be considered the most obscure HTML tag. It is not even one of the tags people are starting to use now more people are actually hand-coding HTML. This tag is so obscure and underused that several seasoned developers I have asked about the tag had never heard of it and when informed of its existence their first question was always 'Does it work in IE6?' As a long-standing member of the HTML family, support for the
base tag is good. We have tested it on IE 3 - 7, Firefox, Opera and Konqueror without any issues. The only time I have ever seen this element used in Microsoft Outlook Web Access.
Anyway, enough of the guff. The base element is a self-closing HTML element that allows HTML documents to have a universal root path for all external media. Below is a brief demonstration on the
base tag in use:
Other then the href attribute, the only other attribute supported by the
base tag is the target attribute. This is handled the same as the target attribute on a hyperlink. So if you really want to you could force all hyperlinks to open in a new window. The only elements that take precedence over the base element's path are the object and depreciated applet elements.
A Few Other Notes on the Base Element
- It must be includes in the docuemnt's head, although IE6 < allows you to place it anywhere
- It support relative paths, e.g. href="../scripts"
- All URL's beginging with http:// or other protocols are ignored by base
- If you have a bandwith hungry site, using the base element could cut a kilobyte or two of each document
Adding A Bit of Server-side Scripting
Advantages of the Base Element
- Provides global access to the root path through HTML
- Can change all paths with one edit
- Results in reduced HTML
- Better facilitates URL re-writing
Disadvantages of the Base Element
When used in conjunction with Microsoft's Alpha Image Loader in external style sheets you will need to declare the source with the root path. If you use a relative path the image will not be loaded when outside the root, because the Alpha Image Loader ignores the base element's declaration. Cheers Bill!
All comments are moderated for spam and will not be shown. All genuine comments wil be show, however the links will be based on a NO FOLLOW RULE. Repeat commenters adding value to the articles and discusions will have removed alowing Follow Rule to Work.
Make a Comment
See Full Portfolio Some Of Our Work
Driving Schools Booking Service (DSBS) is a network of driving instructors, covering the whole of the UK. For this project, we were...
County Security is a fully featured E - commerce solution, with an integrated "system configurator", which allows users to choose...
Customer News & Resources
At Mutiny Design we are constantly gathering together articles and help guides to assist our clients.Introduction to sitemap.xml
Checking for a sitemap A site map (or sitemap) is a list of pages of a web site accessible to crawlers or users. It can be either a document in any form used as a planning tool for web design, or a web page that lists the pages on a web site, Some developers feel that site index is a more appropriately used term to relay page function, web visitors are used to seeing each term and generally associate both as one and the same. However, a site index is often an A-Z index that provides access to content, while a site map provides a general... Read More »Center a web page in CSS
One simple way to center a web page using CSS is to create a container div, that is horizontally centered by having its left and right margins set to auto. Using this method, you can still apply colours / background images to the body tag, so its a flexible solution. (if you didnt need this ability, just apply margins and width to the body tag instead, and forget using the container div). The container div has the same width as your webpage and, well, contains it. All the code for your web page is placed inside the container div. This will... Read More »