www.webdeveloper.com
Results 1 to 8 of 8

Thread: Image rendering problem

  1. #1
    Join Date
    Jul 2008
    Posts
    168

    Image rendering problem

    Hi, i dont think im doing this wrong, however i cannot get any of my images to render from css, this is the code.
    Code:
    #right_top_box
    {background:url(right_top_box.gif) no-repeat;}
    To me thats looks fine but it wont work, ive tried linking directly from my server html directory and ive also tried linking from a folder, ie putting all my images into a seperate folder and linking to that.

    However the only way i can get it to work is to do this:
    HTML Code:
    <div id="right_top_box"><img src="left_top_box.gif" alt=""/></div>
    Code:
    #right_top_box
    {background:url(right_top_box.gif) no-repeat;}
    As you can see i have to put the image link into the html page as well as the css page in order for it to render, but the image is a background so it should render from the css, shouldn't it?
    Am i doing it wrong? as i dont think i am
    thanks.

  2. #2
    Join Date
    Mar 2007
    Location
    Orlando
    Posts
    670
    Looks okay to me. Are you sure that the image path is correct?

  3. #3
    Join Date
    Jul 2008
    Posts
    168
    Absolutely, its really wierd coz the site logo will render fine on all pages without probs and the mouseover image for that is fine too, its just page content images won't render in css alone, its drving me mad as i know im doing it right, ive tried
    Code:
    {background-image: blah;}
    as well as the code ive already posted and unless i put it in both html and css it wont render.
    I'm really stumped

  4. #4
    Join Date
    Aug 2006
    Posts
    1,902
    Is there any chance there is no content in #right_top_box, and its size is 0px?

    Dave

  5. #5
    Join Date
    Jul 2008
    Posts
    168
    Ah i think i know what you mean ie no content so no background for it?
    Il try that then come back in and let ya know.

  6. #6
    Join Date
    Jul 2008
    Posts
    168
    Hi again no that didn't work either

  7. #7
    Join Date
    Jul 2008
    Posts
    168
    Scratch that you rock! it did work i had spelt height wrong so the image didnt show, thanks very much thats been driving me nuts

  8. #8
    Join Date
    Aug 2006
    Posts
    1,902
    Awesome

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