Reply to Re: <base /> tag

Your name:

Reply:


Posted by Jukka K. Korpela on 12/18/05 09:49

Mark Simon <mark@comparity.not.example.net> wrote:

> I like to use the <base> tag in, say, the contents frame of a frameset.

Just don't use frames. Problem solved. Now, assuming you still wish to create
problems by using frames,...

> The idea is that the target attribute will direct all of the links into
> another frame.

Then you would need to use a Transitional DTD, since Strict DTDs disallow the
target attribute.

> The base tag technically has a required href attribute,

Only in Strict DTDs, which are out of the question anyway when you use the
target attribute.

I hadn't noticed that Strict DTDs make the href attribute required, but
that's actually quite logical: since the target attribute is disallowed, the
only possible purpose for the <base> tag would be to set the base address for
URLs. Thus, if you are using a Strict DTD and you use a <base> element
without a href attribute, you have made some error in your thinking or
coding, so it's useful to regard this as a syntax error.

> However, without it, the page won't validate properly.

Posting the URL would, as so often, made it possible to others to help you
better. Yet, it seems pretty obvious that the analysis above is correct.

> Is there a valid href value I can use which will allow other relative
> links on the page to work?

No. The <base href="..."> construct by definition sets the base address for
_all_ relative URLs (not just links).

P.S. There's no point in using XHTML instead of HTML 4.01 on the web; it just
causes confusion.

> The only "correct" solutions I can think of are either to simply put
> targets into all of my links, or to use absolute addresses ... ?

The correct solution is to stop using frames.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация