Skip navigation
Currently Being Moderated

Centre wide image without horizontal scroll

Apr 3, 2012 8:22 PM

Hi

 

I wonder if somebody could help me out.

I have a website header image which is extra-wide to accommodate for any screen size.

The person I’m making the website for loves the design but is dead-set against background images (various reasons I won’t go into).

 

Is there a way to keep the header image centred without the whole page stretching to the pixel width of the header (and without RESIZING the image to fit any screen size)? So that the sides of the header are just cropped off?

 

Any help would be hugely appreciated!

 
Replies
  • Currently Being Moderated
    Apr 4, 2012 6:12 AM   in reply to m00n_s00n

    Unfortunately if you place it as an image, the page will have scroll bars and the only way to avoid that is to use a background which is not an option. 

     

    Personally speaking, you should really consider making the header image that can stretch to any screen size because "extra-wide" is a matter of opinion rather than a stated width.  For instance, let's say I have an old laptop with an 800x600 resolution, a cheap Dell monitor with 1280x1024 resolution and a nice iMac with a 2560x1440 resolution.  Would the extra wide only fit the iMac? Or maybe it would look ok on the Dell?

     

    The point I am trying to get at is that first, sit down with your client and go over their web stats to determine an optimal width, not just extra-wide because it looks nice.  Then cut up that header and code it in CSS with repeating backgrounds as needed and static images on top.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points