You are viewing limited content. For full access, please sign in.

Question

Question

Form Title Background Resize for Mobile

asked on February 10, 2023

Hello! We have a form we're building with a nice, large graphic being used for the form title background, basically to serve as a banner image for the form. When viewed on mobile, however, I can't get it to resize properly. 

Here's how it appears on desktop:

And here's how it looks on mobile:

Ideally, I'd like to have the image we're using take up 100% of the width of the display and then adjust the height accordingly. If anyone knows how to make this happen, I'd greatly appreciate it!

0 0

Answer

SELECTED ANSWER
replied on February 10, 2023

This CSS works for me on Forms Version 11.0.2212.30907 with the title background image set via URL from the theme details.

Classic Designer: 

#cf-formtitle {
    background-size: contain;
    background-repeat: no-repeat;
    width: 100%;
    height: 0;
    padding-top: 50%;   /* this is roughly the image height divided by image width - may need some minor tweaking for best appearance. */
}

 

New Designer: 

.form-header {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 100%!Important;
    height: 0!Important;
    padding-top: 50%!Important;   /* this is roughly the image height divided by image width - may need some minor tweaking for best appearance. */    
}

 

Regarding the part where it says "this is roughly the image height divided by image width - may need some minor tweaking for best appearance".  I mention the tweaking because in my case, the image height divided by image width was 51.84% - but I found it looked best on the Classic Designer at 50% and on the New Designer at 52%.

0 0
replied on February 10, 2023

Thank you very much, Matthew! This will absolutely work for what I'm needing. I appreciate your response, and hope it will help others in the future as well. Have a great rest of your day and enjoy your weekend, sir!

1 0
replied on February 10, 2023

Fantastic!  I'm glad that worked for you.

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.