Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New Coder
    Join Date
    Jan 2008
    Posts
    50
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Can't see background image

    And today was going so well...

    Have a div that is supposed to show a background. I cannot see it in FF or Safari. I am using FF to test with Safari as a backup. FF has the web developer on it, so I can happily say the code is compliant. Sadly, it doesn't work.

    The page is not up yet and is only on the company intranet so I can't provide a link. The following code is the stuff I pulled off the page and put into a test file to see if the image got stuck underneath something else, it didn't.

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    
    <html>
    
    <head>
    <title></title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="stylesheets/test.css">
    
    </head>
    
    <body>
    
        <div id="textarea">
          text
          
        </div> <!-- textarea-->
    
    </body>
    
    </html>
    Code:
    #textarea {
      top:145px;
      left: 144px;
      width: 664px;
      height: 405px;
      position: absolute;
      background-image: url('images/longshot');
      background-color: gray;
      }

  • #2
    Senior Coder jcdevelopment's Avatar
    Join Date
    Oct 2007
    Location
    Cowboy Nation
    Posts
    2,182
    Thanks
    174
    Thanked 257 Times in 257 Posts
    try this

    Code:
    #textarea {
      top:145px;
      left: 144px;
      width: 664px;
      height: 405px;
      position: absolute;
     background-image: url('../images/longshot');
      background-color: gray;
      }
    if not, than you may not have uploaded the image for some reason

  • Users who have thanked jcdevelopment for this post:

    j1adobe (07-15-2008)

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Is anyone else noticing that there is not extension on the url to the image?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #4
    Senior Coder jcdevelopment's Avatar
    Join Date
    Oct 2007
    Location
    Cowboy Nation
    Posts
    2,182
    Thanks
    174
    Thanked 257 Times in 257 Posts
    Quote Originally Posted by _Aerospace_Eng_ View Post
    Is anyone else noticing that there is not extension on the url to the image?
    good catch, i missed that!

  • #5
    New Coder
    Join Date
    Jan 2008
    Posts
    50
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Originally Posted by _Aerospace_Eng_:
    Is anyone else noticing that there is not extension on the url to the image?
    _Aerospace_Eng_, that mistake was made toward the end of the day. It wasn't there all along. It's easy to giggle and laugh at a newbie making dumb mistakes. You were in my shoes once. I don't think you were born with all the knowledge you have now. A comment like that only makes you appear arrogant.

    I didn't run across this problem and immediately run to someone to give me the answer. I tried to figure it out my self first. I read and looked things up and tried to get it on my own. When I finally did post it there was a mistake in what I posted. So what?

    I could point out a grammar mistake you made in your post, but I won't. I don't exist only to give you giggles. A little mutual respect would help here.


    jc, thanks for the help. You pointed me in the right direction. I appreciate it.
    Last edited by j1adobe; 07-15-2008 at 03:13 PM.

  • #6
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,866
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    What _Aero said is you might have missed the file extension like .jpg/ .gif/ .png etc in images/longshot
    Last edited by abduraooft; 07-15-2008 at 02:49 PM.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #7
    New Coder
    Join Date
    Jan 2008
    Posts
    50
    Thanks
    8
    Thanked 0 Times in 0 Posts
    abduraooft,

    I know, but that wasn't the problem. That mistake was made when I retyped the code to post it.

    The problem was that I forgot to take into account the CSS was in a folder. I only checked the path between html and the image files. I didn't back out of the stylesheet folder.

    Dumb I know, but what the heck, I'm a Graphic Designer by training. But I'm learning.

  • #8
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Quote Originally Posted by j1adobe View Post
    abduraooft,

    I know, but that wasn't the problem. That mistake was made when I retyped the code to post it.

    The problem was that I forgot to take into account the CSS was in a folder. I only checked the path between html and the image files. I didn't back out of the stylesheet folder.

    Dumb I know, but what the heck, I'm a Graphic Designer by training. But I'm learning.
    We could have told you that if you had posted a link.

    How are we supposed to know that it was a typo on the image url?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #9
    New Coder
    Join Date
    Jan 2008
    Posts
    50
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Aero;

    Like I said, the site is not online, there is no link yet, it's not that far along.

    It definitely was a mistake on my part to omit the extension. The real problem was I forgot to back out if the CSS folder, as jc pointed out.

    After a long day of struggling with this thing, I took offense to the tone of your answer. People don't like to be talked down to, and they don't like people talking behind their backs, especially in front of their face.

    I don't post every line looking for people here to write my code for me. By the time I do post you can be assured I tried to get the answer and need to ask someone with more experience.

    So, let's be done with this and move on, OK?

  • #10
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    j1adobe: Relax. No one is talking down to you or behind your back. You're making a very big deal out of a completely harmless comment, which leads to things like flame wars, which means the moderator has to get involved, and the moderator does not like getting involved.


  •  

    Posting Permissions

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