Image Stretching

Discussion in 'HTML' started by Lee Harris, Oct 27, 2003.

  1. Lee Harris

    Lee Harris Guest

    Imagine if I had a banner graphic for going across the top of my page in a
    div, but I want it to be 100% of the window, whatever the resolution (so I
    would probably go for a 1024*150 banner image), ie if anyone had a 1280
    display, the image would still just appear once without repeating or tiling,
    or having any blank space to the right of it.

    is it possible to specify 100% as an image width?
     
    Lee Harris, Oct 27, 2003
    #1
    1. Advertising

  2. Lee Harris

    David Graham Guest

    "Lee Harris" <> wrote in message
    news:1_8nb.159$...
    > Imagine if I had a banner graphic for going across the top of my page in a
    > div, but I want it to be 100% of the window, whatever the resolution (so I
    > would probably go for a 1024*150 banner image), ie if anyone had a 1280
    > display, the image would still just appear once without repeating or

    tiling,
    > or having any blank space to the right of it.
    >
    > is it possible to specify 100% as an image width?
    >
    >

    You could start by removing the default padding and margin from the body
    element

    body {margin: 0; padding: 0;}

    Then I would put your image in a div as the divs background and colour the
    divs background a colour that complemts the image in the background of the
    div. If the window resolution is very high and/or the window is wide, then
    a bit of the background colour will show - which is better than white.
    Minimise this by having a background image with a very big width. Even so,
    don't forget the no repeat value as this image is not supposed to tile under
    any circumstances.
    HTH
    David
     
    David Graham, Oct 27, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    1,275
  2. =?Utf-8?B?U3JpZGhhcg==?=

    stretching the background image instead of tiling

    =?Utf-8?B?U3JpZGhhcg==?=, Nov 23, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    8,205
    Mats Lycken
    Nov 30, 2005
  3. Arthur Dent

    Table stretching excessively in IE

    Arthur Dent, Mar 6, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    1,006
    slagomite
    Mar 7, 2006
  4. Rabel
    Replies:
    3
    Views:
    777
    Rabel
    Aug 4, 2008
  5. Chitty
    Replies:
    0
    Views:
    162
    Chitty
    Oct 19, 2004
Loading...

Share This Page