Results 1 to 10 of 10
  1. #1
    Join Date
    Nov 2010
    Posts
    53
    Plugin Contributions
    0

    Default Image Background not displaying

    Hi,

    I am using Alysa Rounded template and have changed the background image by adding a new color code and a gradient image. However, the gradient image doesn't get displayed.

    Example: If you go to my home page www.nameyourgift.ie you will notice the background does not include the "gradientbar" image. However in my stylesheet I have coded the following:

    Code:
    body {margin: 0;font-family: verdana, arial, helvetica, sans-serif;font-size:62.5%;color: #888787; background-image: url
    (../images/gradientbar.png);  background-repeat:repeat-x; background-color: #e8f2f3;}
    I have the exact same code on my test site and it works fine - see here http://test.nameyourgift.ie/zencart/test/.

    This was working previously on my 'live' site so I am thinking there must be a conflict with perhaps another add-on thats causing the image not to be displayed.

    I would appreciate if anyone can help.

    Many thanks

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,492
    Plugin Contributions
    88

    Default Re: Image Background not displaying

    Looking at your page's <body> styling using FireFox's FireBug add-on, there is no such styling defined for the body tag. Are you sure you're editing the right stylesheet.css and then uploading the file to your website's file directory?

  3. #3
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: Image Background not displaying

    Turn off MINIFY and see what happens...
    20 years a Zencart User

  4. #4
    Join Date
    Nov 2010
    Posts
    53
    Plugin Contributions
    0

    Default Re: Image Background not displaying

    Switching off Minify made no difference. When I inspect element with Chrome it shows the background image path but reports an error 'Invalid Property Value'. What does this mean? The image is definitely uploaded to the correct directory (i.e. the templates images folder). Just wondering if another stylesheet is over-riding my main stylesheet? Any other suggestions?

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,492
    Plugin Contributions
    88

    Default Re: Image Background not displaying

    It's not another stylesheet; submitting the CSS for your site to the w3 validator (http://jigsaw.w3.org/css-validator/v...yourgift.ie%2F) results in complaints about the background-image statement in your stylesheet.css file.

  6. #6
    Join Date
    Nov 2006
    Location
    Dartmouth, NS Canada
    Posts
    2,378
    Plugin Contributions
    0

    Default Re: Image Background not displaying

    It's very subtle. Just remove the space character between 'url' and '('. Then the CSS validates, and perhaps the background will appear. I pasted the working body declaration below. (I find it's easier to read the CSS if it's formatted, and the spaces, lines and tabs added to do so do not slow down the load time for modern browsers over modern networks -- YMMV.)

    Rob

    Code:
    body {
    	margin: 0;
    	font-family: verdana, arial, helvetica, sans-serif;
    	font-size: 62.5%;
    	color: #888787;
    	background-image: url(../images/gradientbar.png);
    	background-repeat: repeat-x;
    	background-color: #E8F2F3;
    }

  7. #7
    Join Date
    Nov 2010
    Posts
    53
    Plugin Contributions
    0

    Default Re: Image Background not displaying

    Quote Originally Posted by lat9 View Post
    It's not another stylesheet; submitting the CSS for your site to the w3 validator (http://jigsaw.w3.org/css-validator/v...yourgift.ie%2F) results in complaints about the background-image statement in your stylesheet.css file.
    But why is there no error on my test site http://test.nameyourgift.ie/zencart/test/
    The background syntax in my test stylesheet is the same?

  8. #8
    Join Date
    Nov 2010
    Posts
    53
    Plugin Contributions
    0

    Default Re: Image Background not displaying

    Quote Originally Posted by rstevenson View Post
    It's very subtle. Just remove the space character between 'url' and '('. Then the CSS validates, and perhaps the background will appear. I pasted the working body declaration below. (I find it's easier to read the CSS if it's formatted, and the spaces, lines and tabs added to do so do not slow down the load time for modern browsers over modern networks -- YMMV.)

    Rob

    Code:
    body {
    	margin: 0;
    	font-family: verdana, arial, helvetica, sans-serif;
    	font-size: 62.5%;
    	color: #888787;
    	background-image: url(../images/gradientbar.png);
    	background-repeat: repeat-x;
    	background-color: #E8F2F3;
    }
    There was already no space between 'url' and the image path. The body css is defined exactly the same in my test stylesheet (and works fine) so I am not sure what else I can do to get the background displayed! Any other ideas?

  9. #9
    Join Date
    Nov 2010
    Posts
    53
    Plugin Contributions
    0

    Default Re: Image Background not displaying

    Ok, I have resolved the problem. It seems switching off minify was the answer....It seems this didn't work originally but after I cleared my browser cache the background is now been displayed. Thanks for all your help, very much appreciated.

  10. #10
    Join Date
    Jun 2014
    Location
    India
    Posts
    1
    Plugin Contributions
    0

    Default Re: Image Background not displaying

    I got this problem of invalid property value while doing on wordpress and the suggestion Rob gave about removing space between url and ( helped me resolve a problem I was struggling from 2 days. Just wanted to say thanks.

 

 

Similar Threads

  1. Background Image Not Displaying
    By jhowe in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 14 Jul 2012, 10:19 AM
  2. Page not displaying background.
    By rdcast in forum General Questions
    Replies: 6
    Last Post: 14 Mar 2010, 05:39 PM
  3. background image not displaying
    By melindaf in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 9 Aug 2009, 09:43 PM
  4. Background Images for Sidebox Headers Not displaying In IE.
    By SurrealDesign in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 26 Jan 2009, 05:18 PM
  5. Background image not displaying
    By rwj in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 2 Jun 2008, 07:18 PM

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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR