Results 1 to 4 of 4

Thread: specifying base url for a DIV

  1. #1
    Join Date
    Apr 2005
    Location
    Sydney, Australia
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow specifying base url for a DIV

    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 Code:
    <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>

  2. #2
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by wishiwasageek
    I want to specify a base url for a DIV
    You can't.


    Umm, that's about it, really.

    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

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Thumbs down

    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.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •