Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2004
    Location
    Berkshire, UK
    Posts
    1,482
    Plugin Contributions
    1

    Default How can I stop the image "spilling over" the edge?

    I want to make an image 1280wide*100
    In the middle 800 will be the actual logo, I want the edges to continue WITHIN the viewport bounded by the edge of the "main" centre bit, but instead, it "pushes over" the top.
    ( body { margin: 2%; ] } )
    I can't make a 3 section thing with two "repeating" sections either side, because the logo doesn't work like that. Am I making sense? Probably not!
    To put it another way, I want to main or header wrapper to sit "on top" of the logo, so that when the screen is narrower than the logo, the logo doesn't "break" the layout.

    Anyway, I've been looking here, with no luck.

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

    Default Re: How can I stop the image "spilling over" the edge?

    If I understand correctly:
    You want a header/logo that will fit any window from 800 to 1280px wide seamlessly, with the middle 800 being the actual logo.

    Try a background-image at 1280x100 with the center 800 blank to minimize file size,
    in
    #headerWrapper {
    background-image: url(...);
    background-position: top center;
    }

    Then make your logo at 800x100.

    That should allow the header width to float as the background will not push on its boundaries but will be anchored to the center.

  3. #3
    Join Date
    Oct 2005
    Location
    New Mexico
    Posts
    393
    Plugin Contributions
    0

    Default Re: How can I stop the image "spilling over" the edge?

    Interested to know if Glenn's solution works. Seems counter-intuituve to me. Often wrong on that though.

    The background image of 1280x100 will center on an 800x600 screen size so that there is an 'extra' 240 px on each side? What does that do to the scroll bar?

    If it works though, yippee.

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

    Default Re: How can I stop the image "spilling over" the edge?

    Bruce -

    I tested this on a standalone HTML page, and it does work as the reference said it would.

    The background image doesn't affect the size of the fluid width header, and anchors in the center. When the window is sized down to less than the logo width, a scrollbar appears.

    There is a behavioral oddity which may be due to the pure CSS vs the single table in template_default: when sized down to where the logo won't all fit, the logo keeps its left margin and goes off the right edge of the window and over the edge of the header, while the header keeps fluidly shrinking to keep to 98% of the window as I specified. Scrolling to the right reveals the logo tight to the right edge of the window and the header with a big margin. So the logo and header/background decouple at that point. My guess is that won't happen in a ZC environment.

  5. #5
    Join Date
    Oct 2005
    Location
    New Mexico
    Posts
    393
    Plugin Contributions
    0

    Default Re: How can I stop the image "spilling over" the edge?

    Glenn,

    Thanks for the feedback. I will say more as I experiment with this new info.

    Kelvyn - did your problem get fixed with this?

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

    Default Re: How can I stop the image "spilling over" the edge?

    On further testing, there is a potential fix for the decoupling issue. It is reportedly not supported by IE yet, but works in FF.

    Add the property min-width: xxxpx; to the header CSS, and it won't shrink below that. Make xxx big enough to contain the logo + margins, and all will be well (in FF anyway....;)

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

    Default Re: How can I stop the image "spilling over" the edge?

    Update: min-width does work in IE6 as well as FF. The w3schools reference (copy printed two months ago) seems to be out of date (the most recent versions it mentions are IE4, FF1 and Netscape 6.)

 

 

Similar Threads

  1. Replies: 3
    Last Post: 12 Mar 2015, 03:13 PM
  2. Replies: 16
    Last Post: 18 Oct 2013, 08:43 PM
  3. How can I disable the "Larger Image" link on SOME products?
    By btolly in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 19 Aug 2009, 02:39 PM
  4. On Specials - How can I just display "20% off" or "save $x.xx", but not the price
    By candylotus in forum Setting Up Specials and SaleMaker
    Replies: 0
    Last Post: 24 Apr 2008, 12:44 AM
  5. Can I add an Image to the "Contact Us" an the "About Us" page's
    By PetesTown in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 28 Nov 2007, 05:02 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