Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Oct 2003
    Location
    SC
    Posts
    936
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to vertically strech a background image?

    How to vertically strech a background image?

    than ks in advnaced

  • #2
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,794
    Thanks
    19
    Thanked 156 Times in 147 Posts
    Why would you want to do this with your HTML? I would use Photoshop or a design program to stretch my image and then make it my background....
    Regards, R.J.

    ---------------------------------------------------------

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    You can't, you would have to make it repeat or do what chump said.

  • #4
    Regular Coder
    Join Date
    Oct 2003
    Location
    SC
    Posts
    936
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I wanted it so it fits all resolutions

  • #5
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    The most you can do is have it centered and have a background color that matches a dominant color in the image to make it appear like its resizing.
    Code:
    <style type="text/css">
    body {
    background-image:url(yourimage.jpg);
    background-position:center;
    background-repeat:no-repeat;
    background-attachment:fixed;
    background-color:#000000 /*this should match a dominant color in your image*/
    }
    </style>
    The shorthand version of that would be
    Code:
    <style type="text/css">
    body {
    background:#000000 url(yourimage.jpg) no-repeat fixed center;
    }
    </style>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •