www.webdeveloper.com
Results 1 to 3 of 3

Thread: Cant get image in my editor notepad++

  1. #1
    Join Date
    Apr 2012
    Posts
    110

    Cant get image in my editor notepad++

    Hi, I put the following, in css.

    background-image:url ('Pictures/Webtheme_files/girl1.gif')

    then <body><img src="../Webtheme_files/girl1.gif"; width="238"; height="297";/></body>

    nothing works, tried with "../Pictures/Webtheme_files/girl.gif'"; etc.
    still doesnt work.

  2. #2
    Join Date
    Mar 2012
    Posts
    1,259
    Quote Originally Posted by wildguy2 View Post
    Hi, I put the following, in css.

    background-image:url ('Pictures/Webtheme_files/girl1.gif')

    then <body><img src="../Webtheme_files/girl1.gif"; width="238"; height="297";/></body>

    nothing works, tried with "../Pictures/Webtheme_files/girl.gif'"; etc.
    still doesnt work.
    It seems to me that there are two separate issues here:

    1. The CSS code fragment is doing nothing. I.e. It does not associate the background with an id or element. See here for correct usage. E.g. If you wanted to declare a div called "test" and give it that background, you'd put in the CSS something like:

    #test {
    background-image:url ('Pictures/Webtheme_files/girl1.gif');
    width: 238px;
    height: 297px;
    }

    And in the HTML you'd have something like:

    <body>
    <div id="test">
    <p>
    some foreground text or whatever...</p>
    </div>
    </body>

    2. The HTML fragment you gave is completely irrelevant. You only need to explicitly mention the image in the HTML if you want to put it in the foreground, not the background. And if you did want to put the image in the foreground, the IMG element does not have semi-colons between the attributes. See here. E.g.

    <body>
    <img src="../Webtheme_files/girl1.gif" width="238" height="297" alt="girl" />
    </body>

    Note: The paths to the GIF files differ between the two examples. So you may need to check which (if either) is correct!!!

  3. #3
    Join Date
    Apr 2012
    Posts
    110

    Thanks-solved. put gif and jpg and worked

    Hi, thanks, looked on properties of the image and saw it had the gif. jpg and not just gif. I think it was jpg. but anyway, I put that part in the css and it worked, thanks, it took me 4 months, but I got it right now. thanks for the other info, it helps me greatly,

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles