[Support request] Responsive header

Home Forums Support [Support request] Responsive header

Home Forums Support Responsive header

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #744093
    Viktor

    I use the header to display my photographs

    https://www.phototraces.com/deconstructing-photo/lower-south-desert-outlook-utah/

    but it is not responsive.

    What can I do to make sure it stays responsive. Btw, I disabled the header for small devices.

    #744097
    David
    Staff
    Customer Support

    Hi there,

    if you want to maintain aspect ratio then use % for the padding. You can also set the padding separately for mobile.

    Personally i use one setting for all by dividing the original image height by its width and use the % ratio as the total top/bottom padding.

    #744111
    Viktor

    Dave,

    thanks, I can see it works, but can not figure out the calculations.

    If my header image is 1400 x 700, how do I calculate out exact percentage?

    #744143
    David
    Staff
    Customer Support

    Like so = 700(h) / 1400(w) = 0.5 (50%).
    You can add 25% to both top and bottom padding or 50% to just one of them.
    If you have content in the header element then that changes matters and will require less padding, and is a little trial and error.

    #744167
    Viktor

    It only works if I use Container: Full Width option and not Contained option.

    It looks if it calculates the heights percentage based on total page width and not based on the Page Hero container width.

    #744169
    David
    Staff
    Customer Support

    Aah yes, my bad – the assumption is that the aperture is 100%. In that instance then the width will be based on the width of the container.

    #744849
    Viktor

    does it mean I am out of luck if I use Contained option?

    #744850
    David
    Staff
    Customer Support

    It shouldn’t be. The ratio should still work. You should try making sure that the original image size has the same width as your container.

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