SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2006
    Location
    Atlanta, GA
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Background image

    I am not totally new to CSS, but I recently decided to take it a little more seriously. I do a lot of ASP.Net programming so I usually don't pay that much attention to CSS, Web 2.0, etc.

    I am trying to set a background image on my page. It is displaying, but it is not displaying the whole picture. It is only displaying the top middle portion of my picture.

    Here is the CSS

    body
    {
    background: black url("../../Images/yard.jpg") no-repeat fixed center right;
    }

    Do I need to resize the picture in a program like Photoshop in order to display the whole thing?

  2. #2
    SitePoint Addict Jamieharrop's Avatar
    Join Date
    Mar 2005
    Location
    West Yorkshire, UK
    Posts
    210
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is the background image extending to the edge of the window, Tony? If so, then yes, you will need to reduce the size of the image in a photo editing program such as Photoshop. It is likely your background image will appear in full in larger resolutions though.

    If the background isn't extending to the edge of the window, then there is something else which is causing a problem. In that case, we would need to see the page in question to identify the cause.
    Regards,
    Jamie Harrop

  3. #3
    SitePoint Enthusiast
    Join Date
    Feb 2006
    Location
    Atlanta, GA
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, it is extending to the edge of the entire window. Is there a rule to determine how small I should resize the image in Photoshop so that it will adjust properly depending the end user's browser size?

  4. #4
    SitePoint Addict Jamieharrop's Avatar
    Join Date
    Mar 2005
    Location
    West Yorkshire, UK
    Posts
    210
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Unfortunately it isn't possible to expand or contract a background image depending on screen resolution, Tony. If there was, you would find that the image would become distorted as it is enlarged.

    Just out of interest, how large is your current image?

    I suppose the only solution would be to reduce the size to something that looks reasonable on as many resolutions as possible.
    Regards,
    Jamie Harrop

  5. #5
    SitePoint Enthusiast
    Join Date
    Feb 2006
    Location
    Atlanta, GA
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think I see why now.

    The image is 1536px in height by 2048px in width.

  6. #6
    SitePoint Addict Jamieharrop's Avatar
    Join Date
    Mar 2005
    Location
    West Yorkshire, UK
    Posts
    210
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ouch. Yep, that wouldn't even fit on my resolution which is at the highest possible resolution I can get my laptop to go.
    Regards,
    Jamie Harrop


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
  •