Change image size

Discussion in 'HTML' started by Bruce A. Julseth, Jul 21, 2008.

  1. Is there anyway to specify that an image should stretch and shrink to fit a
    screen background? I can make it "repeat" but I'd like it to adjust as the
    screen is resized.

    Bruce
     
    Bruce A. Julseth, Jul 21, 2008
    #1
    1. Advertising

  2. Bruce A. Julseth

    dorayme Guest

    In article <iz5hk.5036$>,
    "Bruce A. Julseth" <> wrote:

    > Is there anyway to specify that an image should stretch and shrink to fit a
    > screen background? I can make it "repeat" but I'd like it to adjust as the
    > screen is resized.
    >


    Not as background, no. You are confined to repeat in a couple of
    directions and to a few positioning parameters. So the way to work with
    such limitations is to choose/make your image carefully so it looks
    natural when repeated. For example, a straight or even gently winding
    road can be made to meander on forever to the right of a house as a user
    opens his browser wider and wider.

    You can specify an image (using the img element, not a background) to be
    a percentage of a browser window. This is is easily done and the image
    will stretch. Again, one would need to choose an image that lends itself
    to such distortion.

    In the latter case,you can still get backgound image effects by using
    various postioning schemes and margins for other elements. Also
    z-indexing and there are fancy opacity possibilities...

    --
    dorayme
     
    dorayme, Jul 21, 2008
    #2
    1. Advertising

  3. "Bruce A. Julseth" <> wrote in message
    news:iz5hk.5036$...
    > Is there anyway to specify that an image should stretch and shrink to fit
    > a screen background? I can make it "repeat" but I'd like it to adjust as
    > the screen is resized.
    >
    > Bruce
    >


    Thanks for the response. I "play" with repeat to get a good looking
    background.

    Bruce
     
    Bruce A. Julseth, Jul 21, 2008
    #3
  4. Bruce A. Julseth

    Gus Richter Guest

    dorayme wrote:
    > In article <iz5hk.5036$>,
    > "Bruce A. Julseth" <> wrote:
    >
    >> Is there anyway to specify that an image should stretch and shrink to fit a
    >> screen background? I can make it "repeat" but I'd like it to adjust as the
    >> screen is resized.
    >>

    >
    > Not as background, no. You are confined to repeat in a couple of
    > directions and to a few positioning parameters. So the way to work with
    > such limitations is to choose/make your image carefully so it looks
    > natural when repeated. For example, a straight or even gently winding
    > road can be made to meander on forever to the right of a house as a user
    > opens his browser wider and wider.
    >
    > You can specify an image (using the img element, not a background) to be
    > a percentage of a browser window. This is is easily done and the image
    > will stretch. Again, one would need to choose an image that lends itself
    > to such distortion.


    .... and then layer all subsequent document material over the image. The
    image will then function as if it were a flexible background image. All
    without the use of javascript, of course. Is that what you were thinking?

    --
    Gus
     
    Gus Richter, Jul 22, 2008
    #4
  5. Bruce A. Julseth

    dorayme Guest

    In article <g63pkj$19j$>,
    Gus Richter <> wrote:

    > dorayme wrote:
    > > In article <iz5hk.5036$>,
    > > "Bruce A. Julseth" <> wrote:
    > >
    > >> Is there anyway to specify that an image should stretch and shrink to fit
    > >> a
    > >> screen background? I can make it "repeat" but I'd like it to adjust as
    > >> the
    > >> screen is resized.
    > >>

    > >
    > > Not as background, no. You are confined to repeat in a couple of
    > > directions and to a few positioning parameters. So the way to work with
    > > such limitations is to choose/make your image carefully so it looks
    > > natural when repeated. For example, a straight or even gently winding
    > > road can be made to meander on forever to the right of a house as a user
    > > opens his browser wider and wider.
    > >
    > > You can specify an image (using the img element, not a background) to be
    > > a percentage of a browser window. This is easily done and the image
    > > will stretch. Again, one would need to choose an image that lends itself
    > > to such distortion.

    >
    > ... and then layer all subsequent document material over the image. The
    > image will then function as if it were a flexible background image. All
    > without the use of javascript, of course. Is that what you were thinking?


    Yes, that's it, as indicated by my concluding paragraph "In the latter
    case, you can still get backgound image effects by using various
    postioning schemes and margins for other elements. Also z-indexing and
    there are fancy opacity possibilities..."

    The drawback as I see it is it goes against the impulse to keep the html
    as meaningful as possible whereas the image is usually likely to be
    decorative. You mentioned HTML 5 recently I think, perhaps there will be
    greater flexibility in deploying background imagery in it?

    --
    dorayme
     
    dorayme, Jul 22, 2008
    #5
  6. Bruce A. Julseth

    Gus Richter Guest

    dorayme wrote:
    > In article <g63pkj$19j$>,
    > Gus Richter <> wrote:
    >
    >> dorayme wrote:
    >>> In article <iz5hk.5036$>,
    >>> "Bruce A. Julseth" <> wrote:
    >>>
    >>>> Is there anyway to specify that an image should stretch and shrink to fit
    >>>> a
    >>>> screen background? I can make it "repeat" but I'd like it to adjust as
    >>>> the
    >>>> screen is resized.
    >>>>
    >>> Not as background, no. You are confined to repeat in a couple of
    >>> directions and to a few positioning parameters. So the way to work with
    >>> such limitations is to choose/make your image carefully so it looks
    >>> natural when repeated. For example, a straight or even gently winding
    >>> road can be made to meander on forever to the right of a house as a user
    >>> opens his browser wider and wider.
    >>>
    >>> You can specify an image (using the img element, not a background) to be
    >>> a percentage of a browser window. This is easily done and the image
    >>> will stretch. Again, one would need to choose an image that lends itself
    >>> to such distortion.

    >> ... and then layer all subsequent document material over the image. The
    >> image will then function as if it were a flexible background image. All
    >> without the use of javascript, of course. Is that what you were thinking?

    >
    > Yes, that's it, as indicated by my concluding paragraph "In the latter
    > case, you can still get backgound image effects by using various
    > postioning schemes and margins for other elements. Also z-indexing and
    > there are fancy opacity possibilities..."


    And all without the use of javascript, of course. ;-)

    > The drawback as I see it is it goes against the impulse to keep the html
    > as meaningful as possible whereas the image is usually likely to be
    > decorative. You mentioned HTML 5 recently I think, perhaps there will be
    > greater flexibility in deploying background imagery in it?


    Not in HTML5, but certainly in CSS3 (CSS Backgrounds and Borders Module):
    <http://www.w3.org/TR/2005/WD-css3-background-20050216/#the-background-size>

    --
    Gus
     
    Gus Richter, Jul 22, 2008
    #6
  7. Bruce A. Julseth

    David Segall Guest

    "Bruce A. Julseth" <> wrote:

    >Is there anyway to specify that an image should stretch and shrink to fit a
    >screen background? I can make it "repeat" but I'd like it to adjust as the
    >screen is resized.

    I don't think you can but I posted a similar query some time ago
    <http://tinyurl.com/5fy25e> and received some very helpful advice
    including an excellent summary from Nik Coughlin of techniques for
    creating an image that could be right truncated and still be
    acceptable <http://nrkn.com/backgroundWidth/>. Another technique that
    I have employed is to use a series of related images that can be
    truncated <http:profectus.com.au/ee_headingexample_little.html>. You
    can also use an image that is meant to be repeated as I have at
    <http://cheapweb.profectus.com.au/> but I don't think it really works.
     
    David Segall, Jul 22, 2008
    #7
  8. ..oO(Gus Richter)

    >dorayme wrote:
    >
    >> The drawback as I see it is it goes against the impulse to keep the html
    >> as meaningful as possible whereas the image is usually likely to be
    >> decorative. You mentioned HTML 5 recently I think, perhaps there will be
    >> greater flexibility in deploying background imagery in it?

    >
    >Not in HTML5, but certainly in CSS3 (CSS Backgrounds and Borders Module):
    ><http://www.w3.org/TR/2005/WD-css3-background-20050216/#the-background-size>


    Opera 9.5 already supports stretching backgrounds.

    CSS text shadows and background sizing
    http://dev.opera.com/articles/view/css-text-shadows-and-background-sizing/

    Micha
     
    Michael Fesser, Jul 22, 2008
    #8
  9. Bruce A. Julseth

    dorayme Guest

    In article <g64oka$3ht$>,
    Gus Richter <> wrote:

    > dorayme wrote:
    > > In article <g63pkj$19j$>,
    > > Gus Richter <> wrote:
    > >
    > >> dorayme wrote:


    > > The drawback as I see it is it goes against the impulse to keep the html
    > > as meaningful as possible whereas the image is usually likely to be
    > > decorative. You mentioned HTML 5 recently I think, perhaps there will be
    > > greater flexibility in deploying background imagery in it?

    >
    > Not in HTML5, but certainly in CSS3 (CSS Backgrounds and Borders Module):
    > <http://www.w3.org/TR/2005/WD-css3-background-20050216/#the-background-size>


    Of course, yes, what was I thinking? <g>

    --
    dorayme
     
    dorayme, Jul 22, 2008
    #9
    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. danCER
    Replies:
    1
    Views:
    563
    Nico Schuyt
    Jul 14, 2003
  2. Replies:
    2
    Views:
    284
  3. Wongod
    Replies:
    2
    Views:
    736
  4. Jason Cavett

    Preferred Size, Minimum Size, Size

    Jason Cavett, May 23, 2008, in forum: Java
    Replies:
    5
    Views:
    12,698
    Michael Jung
    May 25, 2008
  5. Bob Richardson
    Replies:
    3
    Views:
    253
    Bob Richardson
    Mar 8, 2005
Loading...

Share This Page