473,508 Members | 2,344 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

specifiying a base path for <img ..> tags

In HTML, I would like the base tag...
<base href="http://myserver/dir1/">

....to affect an embedded image src property with a relative path..
<img src="dir2/myimage.jgp">

....such that the image would be fetched from...
"http://myserver/dir1/dir2/myimage.jpg"

Why doesn't the base tag work for this? Is there another tag that does?
Jul 20 '05 #1
1 17570
> In HTML, I would like the base tag...
<base href="http://myserver/dir1/">

...to affect an embedded image src property with a relative path..
<img src="dir2/myimage.jgp">

...such that the image would be fetched from...
"http://myserver/dir1/dir2/myimage.jpg"

Why doesn't the base tag work for this? Is there another tag that does?


How is it failing for you?

There is a nice gotcha with the base tag and images when using domain names
on basic hosting packages where frames are used for 'URL masking' (or
however they want to brand it). If you do "htttp://yourserver/yourpic.jpg"
the end result is a frameset document and not an image file. Fine if you
just want to view the image in its own window but of course useless for an
inline image as the browser wants an image file not HTML to be returned.
End result is a page full of broken images :-)

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
3073
by: Philipp Lenssen | last post by:
My friend has the following problem (background: we want to transform XML to XHTML via XSLT): "We copy XHTML fragments into an output by using the following template: <xsl:template match="*"...
30
3855
by: Toni Mcintyre | last post by:
i'm having 2 problems with the http://validator.w3.org 1. if i have: <meta http-equiv="Content-Script-Type" content="text/javascript"> then why do i need <script type=text/javascript>...
2
1693
by: ThePsudo | last post by:
# SIMPLE VERSION # Is there a way I can create a new <img> tag onClick? # DETAILED VERSON # I'm making a game that involves drawing a path between two points on a grid. I've got the...
15
122075
by: Gérard Talbot | last post by:
Hello all, I'd like to know and understand the difference between, say, <img src="/ImageFilename.png" width="123" height="456" alt=""> and <img src="/ImageFilename.png" style="width:...
7
2732
by: Rocky Moore | last post by:
I have a web site called HintsAndTips.com. On this site people post tips using a very simply webform with a multi line TextBox for inputing the tip text. This text is encode to HTML so that no...
3
5428
by: Henry Johnson | last post by:
Okay - I'm spinning my wheels on this one... can someone help me figure out how to programmatically populate a table cell as follows (from C# code-behind)? I've tried using a Literal control in the...
6
5312
by: terry13 | last post by:
Hi there, This code is working fine in IE7 as submit button for the search form, but not in Firefox. Any ideas why. <img src="../../Images/Go.jpg" width="45" height="20" align="absmiddle"...
4
2001
by: Jon Slaughter | last post by:
I have a captcha system going and for some reason when I use <?php $s = ""; for($i = 0; $i < 10; $i++) { $s = $s.rand(0,9); } $_SESSION = $s; $fn = '/Login/Register/Captcha.php'; echo '<img...
0
956
by: rrs5 | last post by:
Hello, I am a mod_python newbie. I hope this is a right forum to post this question. I have a python publisher script that generates a dynamic html file with a couple of images. How do I...
0
7135
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7342
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7067
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7505
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5650
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4729
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3201
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.