SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Oct 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can't insert image into HTML doc.

    Hi,
    I知 hoping someone can help me please, I知 new to web developing and I知 trying to insert an image into a HTML document but all I keep getting is a blank shape of the image with a red X in the corner and the alt name. The code I'm using is:
    <html>
    <head>
    <title>kh</title>
    <link rel="stylesheet" type="text/css" href="kh.css" />
    </head>
    <body>
    <img src="http:// images/banner.gif" width="157" height="70" alt="KH logo" />
    </body>
    </html>
    I知 using notepad++ as my text editor and WAMP server 2.2 on Win7. The image file is located within the WAMP www directory, as are my notepad PHP and CSS files.

    And the strange thing is if I use the below PHP code instead within the body it pulls it up straight away.
    <?php
    print ("<IMG SRC =images/banner.GIF>");
    ?>
    If anyone could help I壇 really appreciate it?
    Cheers
    J

  2. #2
    Mazel tov! bronze trophy kohoutek's Avatar
    Join Date
    Aug 2004
    Location
    Hamburg, Germany
    Posts
    4,248
    Mentioned
    30 Post(s)
    Tagged
    0 Thread(s)
    You've got a space in the src attribute and a wrong url path which is why the image won't show up.

    It should be:

    HTML Code:
    <img src="images/banner.gif" alt="" width="" height="">
    Maleika E. A. | Rockatee | Twitter | Dribbble



  3. #3
    SitePoint Member
    Join Date
    Oct 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Kohoutek, thank you so much, I have spent hours trying to figure that out :0(. And yet now when I think about it it makes so much sense.

    I know I've got a long way to go and thanks again for your kind advice.

    J

  4. #4
    SitePoint Member
    Join Date
    Mar 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is always the simplest thing, I'm like that sometimes


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
  •