SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question images work in IE, but not in Firefox or Opera

    I have a very simple image and I can not get Firefox or Opera to read the image.
    If I put the image in the same directory as the index . html file, they read the file just fine as they don't need a path, but for some reason they have trouble finding the file in a directory. I have tried everything that I can think of and I can not get this simple little html file to work. What am I doing wrong.




    Code:

    <html>
    <head>
    <title>Programming Alchemist</title>

    </head>

    <body>


    <p><img align = center src="../images/test.gif" alt="" /></p>

    or

    <p><img align = center src="i:/websites/test/images/test.gif" alt="" /></p>



    </body>
    </html>

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Where is the images directory in relation to the webpage?

    Also, you probably want to change "align = center" to at least align="center", if not replace it with CSS altogether.

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. I figured it out though. Actually I cheated and used Maya to see how it was done properly.

    I ended up changing

    <p><img align = center src="../images/test.gif" alt="" /></p>

    to

    <p><img src="images/test.gif" alt="" /></p>

    Now it works.

    Actually, now that I think about it, it makes sense. Where I got the example from was from a css file. Since the ../ means to go up to the next directory where it would find the images directory, that is why I needed to use just the images/test.gif for it to work from the website's root directory. I guess I was trying to think too hard. Anyway, thanks again.

    Last edited by Z.K.; May 14, 2009 at 11:16.


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
  •