Results 1 to 3 of 3

Thread: Stretch image in css

  1. #1
    Join Date
    Nov 2010
    Posts
    114
    Thanks
    27
    Thanked 0 Times in 0 Posts

    Default Stretch image in css

    Hi All,


    iam using a background image with position relative in css. I want to increase the height of image more than it is,

    this is my code

    #background { background: url('img/Background.jpg') no-repeat center center; height: 600px; width: 1024px; position: relative; margin: 0px auto; }

    and in html under body section iam calling this by

    <div id=background>

    when i want to increase the size of background to morethan what it is. image is just moving down. How to fix this issue.

    As my total page is going to be 1024 x 600 i need it to be fixed in all pages such that there should not be any side bar or bottom page bar is it possible. Currntly i am giving border as 50px for the body section. which is give me different types of height in different types of screens.
    Last edited by hemi519; 01-27-2011 at 06:41 AM.

  2. #2
    Join Date
    Oct 2009
    Posts
    845
    Thanks
    14
    Thanked 189 Times in 188 Posts

    Default

    The css you have is defining the size and position of the background div, but it doesn't affect the image size. Maybe the easiest way to get around this is to resize the background image itself. You can do that with photoshop or gimp. An online alternative can be found here. On that page you will be able to upload your image and enlarge it to the desired dimensions.

  3. #3
    Join Date
    Mar 2010
    Location
    Florida
    Posts
    345
    Thanks
    5
    Thanked 33 Times in 31 Posts

    Default

    i have photoshop CS5 so if u want me to change the size or whatever u want just email me

    CRAZYKLD_68@YAHOO.COM (lower case tho)

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
  •