enigma1 - 8:55 am on Oct 10, 2010 (gmt 0)
In general, the base element is more trouble than it's worth, even with "correct" usage it is bad practice. Of course, CMS developers don't always produce the best HTML markup, often the nature of a CMS leads to bloated markup.
Well no and no. To give you an example, web applications may have templates in sub-folders. So if the root of the domain is
and the template is in
And inside template folder you have the stylesheet for the template which is very common, then without the base element, resources in the CSS will have to use a path based on the script where is loaded from, or a fully qualified path.
And that's a bad thing for the template now.
background: url(http://www.example.com/design/templates/blue-template/images/arrow.gif) no-repeat;
So you setup the base to point to the template folder so the CSS will be:
background: url(images/arrow.gif) no-repeat;
And so the template is easily portable because it doesn't need to know the parent folder references.