<base href="file:///..."/> question

D

dfloss

For local html files, this works well. Unfortunately, it also breaks
internal anchor links.

Here is an example:
<head>
<base href="file:///C:/some_folder/" />
</head>

<a href="#SOME_ID_REFERENCE">blah</a> <-- doesn't work -->

Is it possible to make internal links ignore the <base href...> setting?
 
J

Jukka K. Korpela

Scripsit dfloss:
For local html files, this works well.

For what? We can only see a poor solution, not the problem it was supposed
to solve.
Unfortunately, it also breaks
internal anchor links.

Of course it does.
<base href="file:///C:/some_folder/" />

By definition, it sets the base URL of _all_ relative URLs in all
attributes.
<a href="#SOME_ID_REFERENCE">blah</a> <-- doesn't work -->

By definition, it works the way it has been defined to work.
Is it possible to make internal links ignore the <base href...>
setting?

No, except by making them use absolute URLs (which isn't a good idea).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top