Customization led to poor mobile optimization

Topic summary

A user implemented desktop customizations for their collection page that broke mobile display, making it look “strange.” They want the customizations to apply only to desktop views.

Initial Solution Attempt:

  • PageFly-Victor provided CSS code to add to theme.liquid above the </head> tag
  • The user reported this didn’t work, noting they had previously added other code that might be interfering

Alternative Solution:

  • EBOOST suggested a different approach: adding media query code to the bottom of Assets/theme.css instead
  • The code targets collection grid items with specific width adjustments for different screen sizes (max-width: 1024px and 749px)
  • Uses !important declarations to override existing styles

Current Status:
The issue remains unresolved. The user has not confirmed whether EBOOST’s alternative solution worked. Screenshots show the desktop version displays correctly while mobile needs optimization.

Summarized with AI on November 23. AI used: claude-sonnet-4-5-20250929.

As you can see, my website on desktop looks as intended, however on mobile, it is not optimized correctly. On mobile, it looks strange. I only want the customization I made to be shown on desktop

https://www.dior.com/en_us/fashion/mens-fashion/ready-to-wear/knitwear-sweatshirts

Hi @gihan7575

This is Victor from PageFly - Shopify Page Builder App

Please add this code to your theme.liquid above the to get this solved

Step 1: Online Stores > Themes > More Actions > Edit code

Step 2: click on theme.liquid and paste the code above the


Hope this can help you solve the issue

Best regards,

Victor | PageFly

Hey, this did not work. I previously copied your code for another solution. I am not sure if the code is interfering. This is how I pasted the code, along with the other solution.

@media screen and (max-width: 767px){ li.small--one-half { width: 100% !important; } } @media screen and (min-width: 1024px){ // paste your customization code here for desktop }

Hi @gihan7575

May I suggest to update code these steps:

  1. Go to Store Online-> theme → edit code
  2. Assets/theme.css
  3. Add code below to bottom of file
@media(max-width: 1024px){
	#Collection .grid--view-items  li.small--one-half {
		width: 33.33333%!important;
	}
}
@media(max-width: 749px){
	#Collection .grid--view-items {
		margin-left: 0;
	}
	#Collection .grid--view-items  li.small--one-half {
		width: 50%!important;
	}
}