[Resolved] problems with background image scaling

Home Forums Support [Resolved] problems with background image scaling

Home Forums Support problems with background image scaling

  • This topic has 8 replies, 2 voices, and was last updated 5 years ago by Leo.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #872797
    Melissa

    I’m having trouble understanding what is going on with my header hero images. The vertical size seems to be entirely dependent on how I set the top margin in the element (invisible at 0% stretching to huge as the percentage goes up). In addition, no matter the size, the images getting cropped. I just want it to use the dimensions of the given photo.

    Please help!

    #872802
    Leo
    Staff
    Customer Support

    Hi there,

    That’s actually just how the background images work – how much it shows depends on the size of the content.

    In this case, the height is controlled by the top and bottom padding as explained here:
    https://docs.generatepress.com/article/header-element-overview/#padding

    If this doesn’t help, any chance you can link me to the page in question so I can see the issue?

    Let me know ๐Ÿ™‚

    #872810
    Melissa

    So I can’t get it to just use the photo dimensions?

    And why is it cropping? It does that no matter what padding I set.

    #872813
    Melissa

    Alas, the site is local right now during development.

    #872816
    Leo
    Staff
    Customer Support

    You’d have to tweak the top and bottom padding.

    It doesn’t crop the image by default (unless the original image is wider than the container width).

    Background images aren’t responsive by nature (it’s not a theme thing).

    Perhaps try changing the background image position?
    https://docs.generatepress.com/article/header-element-overview/#background-image-position

    If this doesn’t help, any chance you can duplicate the issue on a live server? It’s really hard for me to tell without looking at it.

    #872818
    Melissa

    Well, it is wider than the content width. I think I need that to work on larger screens, right? Even if my page content remains narrower.

    #872894
    Leo
    Staff
    Customer Support

    Are you using full width? If so then yeah how much the background image show will depend on the screen size.

    You can test by resizing the browser.

    #872912
    Melissa

    Ok, thanks for your help. I will fiddle with things and if I can’t get it working, I’ll see if I can get it up on a live server later.

    #872914
    Leo
    Staff
    Customer Support

    No problem!

    It would definitely be easier for me to provide some tips if I can see the issue ๐Ÿ™‚

    Here are some examples as well if you haven’t found them yet:
    https://docs.generatepress.com/article/page-hero-examples/

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.