Forum Moderators: open
It's also claimed <base href...> will be obsoleted in future HTML versions. Is there any substance to this?
I've just implemented the tag on my site (mainly for experimental purposes), and it validates as XHTML 1.0 strict.
Also, are there any real practical benefits of using <base href...>? AFAICS it falls into the "nice-to-have" category, but will it make my pages user/browser/bot-friendlier?
Whatever, I'll be going over to using absolute URLs soon anyway, just to be on the safe side :-))
[edited by: tedster at 6:51 pm (utc) on Mar. 12, 2005]
[edit reason] fix formatting [/edit]
<base ...> element are highly exaggerated: it will become extinct when HTML becomes extinct, in which case you'll need to redo your document anyway. The document quoted in the other thread is simply wrong. As you've seen the following syntax: <base href="http://example.com/"> Is valid for both strict and transitional doctypes (add the trailing slash for XHTML).
The syntax
<base target="whatever"> (as used in a framed document) is only valid with a transitional doctype - but that's not the one we are concerned with when it comes to the page-jacking problem. The advantage would come when someone steals a page and doesn't edit the source code: all links on that page would correctly resolve to your site and not their copy.
With your answer, and reading a bit further, I found I hade a misconception about the function of the tag; I thought it was the base URL of the site, not the page. Putting the page URL in is definitely a Good Thing TM.