Page 1 of 5 123 ... LastLast
Results 1 to 10 of 44
  1. #1
    Join Date
    Aug 2006
    Location
    West Virginia
    Posts
    321
    Plugin Contributions
    1

    Default Background image cover entire background w/one image

    Hello, I cant figure out what CSS to use in my stylesheet under the body section to get a image to cover the entire background. I don't want 1 image "background-repeat:no-repeat" and I don't want several images using " background-repeat:repeat". What would I use to get the image to cover the background no matter what size?

    Thanks!

  2. #2
    Join Date
    Jun 2003
    Posts
    33,715
    Plugin Contributions
    0

    Default Re: Background image cover entire background w/one image

    As in, you want the image to stretch and shrink?
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  3. #3
    Join Date
    Aug 2006
    Location
    West Virginia
    Posts
    321
    Plugin Contributions
    1

    Default Re: Background image cover entire background w/one image

    Stretch with different sized windows.

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Background image cover entire background w/one image

    Unfortunately, that's not possible. Background images are the size they are (in pixels) and do not stretch.

  5. #5
    Join Date
    Aug 2006
    Location
    West Virginia
    Posts
    321
    Plugin Contributions
    1

    Default Re: Background image cover entire background w/one image

    I found some examples that it is working on websites but I don't know where to start?

    Example 1

    Example 2

    Thanks!

  6. #6
    Join Date
    Jun 2003
    Posts
    33,715
    Plugin Contributions
    0

    Default Re: Background image cover entire background w/one image

    Them implement the stuff in the tutorial ...
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  7. #7
    Join Date
    Aug 2006
    Location
    West Virginia
    Posts
    321
    Plugin Contributions
    1

    Default Re: Background image cover entire background w/one image

    Ok, I got it to work somewhat. My image is on top of my web site instead of in the background But it stretches. Here is what I did....
    I added a div in the body of my tpl_main_page.php
    Code:
    <div id="bg"><img src="includes/templates/Primitive/images/TestImage.gif" width="100%" height="100%" alt=""></div>
    and then I added
    Code:
    #bg {position:fixed; 
    top:0; 
    left:0; 
    width:100%; 
    height:100%;
    to my stylesheet.css. What am I doing wrong?

  8. #8
    Join Date
    Aug 2006
    Location
    West Virginia
    Posts
    321
    Plugin Contributions
    1

    Default Re: Background image cover entire background w/one image

    Any ideas? Thanks!

  9. #9
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Background image cover entire background w/one image

    Any positioned element will display on top of non-positioned elements. You need to position the rest of the page content, the way the example does with the "content" div. You would probably want to make #mainWrapper position: relative; and z-index: 1; like the example.

    You don't say where you added your new div; it needs to be outside of the #mainWrapper div.

  10. #10
    Join Date
    Feb 2011
    Posts
    6
    Plugin Contributions
    0

    Default Re: Background image cover entire background w/one image

    for any one that stumbles across this as i did, the css for it is now.
    Code:
    body {
    	margin: 0;
    	font-family: verdana, arial, helvetica, sans-serif;
    	font-size: 65.5%;
    	color: #000000;
    	background-color: #e5edf5;
    	background-image: url(../images/background.jpg);
    	background-repeat: no-repeat;
    	background-attachment: fixed;
    	background-position: center top;
    	background-clip: border-box;
    	background-origin: padding-box;
    	background-size: auto auto;
    	}

 

 
Page 1 of 5 123 ... LastLast

Similar Threads

  1. Exteding background image to cover main page edits
    By ScottDB in forum Templates, Stylesheets, Page Layout
    Replies: 20
    Last Post: 12 Sep 2011, 08:30 PM
  2. add background image to a attribute then have that background image act as hyperlink
    By sike1234 in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 14 Nov 2008, 05:38 PM
  3. How to Change Background Colour to Background image
    By ittybittykitty in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 9 Aug 2008, 04:36 PM
  4. background image only showing on one row
    By crabdance in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 2 Nov 2007, 05:02 PM
  5. Can I use a background image for entire pages?
    By bluealice in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 25 Jan 2007, 10:56 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