Jump to content

Mobile cropping different to desktop

Recommended Posts

Hi, here's a code snippet to display the main navigation page on mobile view in the same manner as desktop view:

@media only screen and (max-width: 640px) {
	body#collection-64d776f4e7e1d17768b92716 img.js-index-item-image {
		width: 100% !important;
		height: 100% !important;
		left: 0 !important;
		top: 0 !important;
		object-fit: cover !important;
		object-position: center !important;
	}

	body#collection-64d776f4e7e1d17768b92716 .index-item-height-large:not(.index-item-width-grid) .index-item {
		height: 30vh !important;
	}
}

If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. 

Sam
Web Developer & Digital Designer

 Did you find my contribution helpful? Buy me a coffee?

Link to comment
2 hours ago, visitjamie said:

Thank you Lesum, I tried adding this in the DESIGN > CUSTOM CSS pane but it didnt appear to change anything - am I doing it right? Images below, thanks

image.thumb.png.93c26074d41693ab28ba8e5db1a53252.png

Screenshot 2023-08-13 at 10.23.06.png

Remove the previous code and the code below.

@media only screen and (max-width: 767px) {
  #collection-64d776f4e7e1d17768b92716.index-item-height-large:not(.index-item-width-grid) .index-item {
    height: 56vw !important;
  }
}

 

Screenshot_123.png

If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks

MD Rofik
Website Designer and Digital Marketer

Am I helpful? Want to offer me a coffee?
Send me a message if needed any help. I'll try to reply as soon as possible.


 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • 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.