Log in

View Full Version : specifying base url for a DIV



wishiwasageek
06-14-2005, 05:21 AM
Hello there!
I want to specify a base url for a DIV
WHY-
because the code within this particular div is generated by a program

Within the program I can only specify relative or absolute urls.
This site isn't on the internet or intranet so the absolute links can be really really long and "nested"
I don't want to move the directory "c:/librarylinks/samplefiles/subdirectory" at the moment but may move it later


I just want to know if it's possible without getting too absolute on the links, to specify a base url for a div.

for example the page is in a directory/Folder called "c:/website/HTMLPages" and might look like this:


<html>
<head>
<LINK REL="stylesheet" type="text/css" href="/CSS/stylesheet01.css" />
<link REL="stylesheet" type="text/css" href=/CSS/stylesheet03.css" />
</head>
<body>
<a href="/links/Page1.html">Page 1 </a>
<a href="/links/subdirectory/sub/sub/Page2.html">Page 2 </a>
<a href="/links/subdirectory/Page3.html">Page 3 </a>
(lots of links)
<div>
!--Within this div, the links are in a totally different directory say - "c:/librarylinks/samplefiles/subdirectory"
but are all relative to <u>each other</u>--!
<a href="directory/sub/sub/RelativePage1.html"> Page 1</a>
<a href="directory/sub/RelativePage2.html"> Page 2</a>
<a href="RelativePage3.html"> Page 3</a>
(lots of links)
</body>
</html>

mwinter
06-16-2005, 01:37 AM
I want to specify a base url for a DIVYou can't.


Umm, that's about it, really. :p

HTML documents have an implicit base URL. They can also be given an alternative base URL (though that's not necessarily a good idea), but you can't assign a base URL to specific portions of a document.

Mike

Twey
06-20-2005, 09:00 AM
You could (not recommending this) have a seperate page with a seperate base, then include it with an iframe rather than a div. However, iframes are rather unreliable, and don't work in a lot of browsers.

jscheuer1
06-20-2005, 09:33 AM
For a local only installation, that (an iframe) sounds like a really good idea. You wouldn't even need to set a base url, you could put the content page for the iframe in the 'base' directory.