Jump to content

Make background images relative to view port

Recommended Posts

Site URL: https://www.rockpointcommunity.co.uk/

Hi,

im fairly new to web design and CSS but I am starting to get there..

I have a question regarding responsive design.

So I have created background images to use on my site however I am struggling with these not being responsive. I appreciate I will likely not be able to use the same images on a desktop view and mobile view, but I am struggling even with slight viewport changes in desktop mode.

I was wondering how I could upload my bg image and set its dimensions relative to the viewport of the screen?

Any responses will be much appreciated! 
 

Thanks

Link to comment
  • Replies 2
  • Views 658
  • Created
  • Last Reply

Hi. You mean Rockpoint Community image?

Add this to Design > Custom CSS

/* resize mobile background */
@media screen and (max-width:767px) {
body.homepage #page section:first-child {
    min-height: 20vh !important;
    height: 50vh;
    margin-top: 20vh;
}
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 4 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.