Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with base href

Status
Not open for further replies.

anorakgirl

Programmer
Jun 5, 2001
103
GB
hi,
i'm having problems using the base tag, and i'm not sure where they're coming from.

in the head of my document, i have

Code:
<base href=&quot;[URL unfurl="true"]http://localhost/sitedir/&quot;>[/URL]

my images are in a subdirectory of the main directory
i.e. i could access an image at

Code:
[URL unfurl="true"]http://localhost/sitedir/imagedir/image.gif[/URL]

im my html, the images are referenced like this:

Code:
<img src=&quot;images/image.gif&quot;>

so far as i can see that looks right, but when i look at the site in internet explorer 6, the images are not displayed. it seems to take ages trying to download them, and if i right click where an image should be, and choose properties, the url for the image is correct.

i can't see what i'm doing, i'm guessing it must be a browser problem rather than a server problem, although i'm running through IIS on windows 2000 for info.

anyone had a similar problem, or cans ee what i'm doing wrong with my base tag?

thanks! ~ ~
 
What BASE does is it sets the path of anylink relative to where the href in the base is. Therefore your default directory is sitedir/. You need to get to sitedir/imagedir/image.gif, so your link needs to be like this.
<base href=&quot;<img src=&quot;imagedir/image.gif&quot;>

Rick
 
oops that was a typo in my original post, i did actually have the image tag like that, just wrote
Code:
images
rather than
Code:
imagedir
in my example.

funnily enough a reboot seems to have it all working as i expected it should, computers, grr!

thanks anyway.
~ ~
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top