CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    May 2009
    Posts
    4

    background image not showing

    hi im making a simple site nothing to fancy. im useing dreamweaver to create it, now the background image is viewable on dreamweaver on my computer. but when i uploaded the pictures and the site to my server (powweb) the background picture is not viewable at all tho all the other pictures on the site that i uploaded are.

    heres the site http://www.mramerican.us

    section from my css style sheet:

    Code:
    body {
    	
    	background-image: url("americanflagbackground.JPG");
    	background-position: top right;
    	background-repeat: no-repeat;
    	background-attachment: fixed;
    
    section from my html index page:
    
    {
    	background-image: url("americanflagbackground.JPG")
    }
    body {
    	background-image: url(americanflagbackground.JPG);
    Last edited by PeejAvery; May 23rd, 2009 at 03:43 PM. Reason: Added code tags.

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: background image not showing

    You're problem is case-sensitivity. The file you uploaded is americanflagbackground.jpg not americanflagbackground.JPG.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: background image not showing

    Why do you have this :
    Code:
    {
    	background-image: url("americanflagbackground.JPG")
    }
    body {
    	background-image: url(americanflagbackground.JPG);
    Instead of just :
    Code:
    body {
    	background-image: url(americanflagbackground.JPG);
    }
    ¿
    Or should it be like that ¿
    Granted, I'm not the best designer in the world, but I really think that the Background image declaration above the body declaration is overkill.
    Last edited by HanneSThEGreaT; May 25th, 2009 at 08:03 AM.

  4. #4
    Join Date
    May 2002
    Posts
    10,943

    Re: background image not showing

    Two things...

    1. Hannes is right. The first declaration of the image is invalid since it isn't addressing any tag or name. Remove that part of code.

    2. It will work with quotes, but having quotes there is invalid CSS.
    Last edited by PeejAvery; May 26th, 2009 at 07:03 AM. Reason: Mispelling.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  5. #5
    Join Date
    Oct 2008
    Posts
    29

    Re: background image not showing

    You only need quotes for strings with spaces in them.
    Like setting a font, some fonts (lucida grande) have spaces so you would need quotes:
    Code:
    element {
        font-family: 'lucida grande';
    }
    With out spaces quotes are not needed.
    Code:
    element {
        font-family: arial;
    }

  6. #6
    Join Date
    May 2009
    Posts
    4

    Re: background image not showing

    ok thanks for the info. not sure why the declartion was there. and thanks i didnt even notice the caps.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured