Results 1 to 7 of 7
  1. #1
    Join Date
    May 2007
    Posts
    12
    Plugin Contributions
    0

    Default problem with left and right background image position

    Hi, I'm having trouble with the position of background images I have added on the left and right side of my website.
    It fits well with a 1152x864 screen resolution, but will overlap with any other resolution.

    I went through many posts on this forum, and I know that the solution would be either on the css or in my tpl_main_page.php file, but I have tried many many things, and none did succeed !

    Could please anyone have a look at my site (still under construction) : http://www.naiah.fr/shop/
    and tell me what would be wrong ?

    Fred

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

    Default Re: problem with left and right background image position

    You have your #flowersleft and #flowersright divs absolutely positioned with respect to the left edge, but you have #mainWrapper positioned with margin: auto; so that it will always be centered in the screen.

    This can inherently only work with one screen width. Position #flowersright with respect to the right edge, and try a percent instead of static pixel distance for both of them. Finally, give #mainWrapper a position: relative; (without specifying any shift) and a z-index: 100; so it will overlap the flowers decorations on smaller screens instead of the flowers covering the content.

  3. #3
    Join Date
    May 2007
    Posts
    12
    Plugin Contributions
    0

    Default Re: problem with left and right background image position

    Quote Originally Posted by gjh42 View Post
    This can inherently only work with one screen width. Position #flowersright with respect to the right edge, and try a percent instead of static pixel distance for both of them. Finally, give #mainWrapper a position: relative; (without specifying any shift) and a z-index: 100; so it will overlap the flowers decorations on smaller screens instead of the flowers covering the content.
    ok, thanks a lot for your prompt reply . find hereafter my modifications on the css :


    #navMainWrapper {
    margin: 0em;
    margin-bottom: 0px;
    height: 26px;
    font-weight: bold;
    color: #ffffff;
    padding: 15px;
    background-image: url(../images/nav_cat_bg.gif);
    background-repeat: no-repeat;
    overflow: auto; /* Added for Firefox for screen shift */
    position:relative;
    z-index: 100
    }

    #flowersleft {
    background:url(../images/bg_flowers_left.png);
    width:88px;
    height:380px;
    position:absolute;
    left:7%;

    }
    #flowersright {
    background:url(../images/bg_flowers_right.png);
    width:88px;
    height:380px;
    position:absolute;
    left:85%;
    }

    I have also modified this :
    #navColumnOneWrapper, #navColumnTwoWrapper, #mainWrapper {
    margin: auto;
    position:relative;
    z-index: 100
    }

    so, it looks better than earlier, but still, i'm trying to get something like http://www.miserylovesco.ca/

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

    Default Re: problem with left and right background image position

    #flowersright {
    background:url(../images/bg_flowers_right.png);
    width:88px;
    height:380px;
    position:absolute;
    right: 7%;
    }

    Also, when adding a property to #mainWrapper, add it to the individual #mainWrapper declaration. Adding it to the group declaration gives the same property to all of #navColumnOneWrapper, #navColumnTwoWrapper and #mainWrapper; this probably won't make a difference here, but it often will mess something up. If there were no other #mainWrapper declaration, you should separate this one from the other two:

    #navColumnOneWrapper, #navColumnTwoWrapper {
    margin: auto;
    }

    #mainWrapper {
    margin: auto;
    position:relative;
    z-index: 100
    }

    but since there already is one at the top of the /*wrappers*/ area, just put all its properties there.

    Not sure why you changed #navMainWrapper, as this should not be necessary for this purpose.

  5. #5
    Join Date
    May 2007
    Posts
    12
    Plugin Contributions
    0

    Default Re: problem with left and right background image position

    ok, thanks for your explanations and your corrections. I'm not very comfortable with css yet (i will attend a training session on css next october).

    And for higher screen resolutions (>1200x800), I suppose I should get a wider png file and modify the css, correct ?

    Fred

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

    Default Re: problem with left and right background image position

    The point of my suggestions was to make the layout adaptable to any screen resolution without further modifications. The flowers will stretch out farther on larger screens.

    I looked at your example site and it appears the desired effect is to have the flowers always tight to the mainWrapper. They have a slightly different approach and I'm not entirely sure how it works. I would have to poke around and experiment some.

  7. #7
    Join Date
    May 2006
    Posts
    32
    Plugin Contributions
    0

    Default Re: problem with left and right background image position

    I'm trying to figure this out....

    i want to add images to the right and left of my store, but i'm a little stumped.

    looking at the css for http://www.naiah.fr/shop/

    i see:

    #flowersleft {
    background:url(../images/myimagesL.png);
    width:250px;
    height:440px;
    position:absolute;
    left:4%;

    }
    #flowersright {
    background:url(../images/myimagesR.png);
    width:250px;
    height:440px;
    position:absolute;
    right:4%;
    }

    i understand how it's calling the images, but if i copy the above to my css, the images don't show - what other PHP code do i need to change so the images show up?

 

 

Similar Threads

  1. Left and right screen of my Zencart I have a blueish background, can I put a photo?
    By popemil in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 25 Aug 2010, 01:18 PM
  2. Seperate Sidebox Content Background Images for left and right sideboxes.
    By Jordin in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 22 Jan 2010, 10:31 PM
  3. Adding Background images to RIGHT and LEFT
    By spectreman in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 20 Jun 2009, 04:24 AM
  4. Specials on left displaying right name but link and image are not right
    By carollehmanncl in forum Setting Up Specials and SaleMaker
    Replies: 1
    Last Post: 29 Oct 2008, 02:42 AM
  5. A little problem with changing size of left and right columns
    By djfox in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 13 Sep 2007, 11:35 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