Jump to content

How to automatically adjust picture size to screen size

Recommended Posts

This is my dad's website: www.tremsky.com

He is wondering if there is a way to make all the pictures on all the pages, to automatically fit to screen size, independent of which screen it is.

I found this after doing some research:

   * {
       margin: 0;
       padding: 0;
   .imgbox {
       display: grid;
       height: 100%;
   .center-fit {
       max-width: 100%;
       max-height: 100vh;
       margin: auto;

<img class="center-fit" src='pic.png'>

Would that help in any way? And how would I go about using it?

Link to comment
  • Replies 0
  • Views 454
  • Created
  • Last Reply


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.