We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Changing product page width without affecting any other width settings

Solved

Changing product page width without affecting any other width settings

Pah34H
Tourist
5 1 0

How can I change the product page width without changing any other width settings? I changed the page width to 1600 px which I want to keep but it will make my product page to wide (first image).
I used the code below but it will make some strange changes to the entire side (image two).


{% if template == "product" %}

<style>

@media screen and (min-width: 768px) {

.page-width { max-width: 1000px !important; } }

</style>

{% endif %}

 

This is how it looks without the code changes (to wide)

 

 

This is how it looks after the code changes (header and everything else is changed)

 

Accepted Solution (1)
Pah34H
Tourist
5 1 0

This is an accepted solution.

Ok I found a solution:

 

Step 1: Go to Online Store->Theme->Edit code
Step 2: Asset->/section-main-product.css->paste below code at the bottom of the file:

 

@media (min-width: 768px) { [id^="MainProduct-template"] { --page-width: 1600px !important; } }

View solution in original post

Replies 3 (3)

AnneLuo
Shopify Partner
1381 240 281

Hi, @Pah34H 

You should not modify the style of page width separately, but need to modify the style of the intermediate product container. Just like below

{% if template == "product" %}
 <style>
  @media screen and (min-width: 768px) {
    .page-width.xxx { max-width: 1000px !important; } 
  }
 </style>

{% endif %}
If this is helpful, please Like and Accept the solution.
Want to modify or custom changes on store? Let me help.
- Feel free to Email Me   

Buy Me A Coffee

Pah34H
Tourist
5 1 0

The above code is unfortunately not working for me

 

Pah34H
Tourist
5 1 0

This is an accepted solution.

Ok I found a solution:

 

Step 1: Go to Online Store->Theme->Edit code
Step 2: Asset->/section-main-product.css->paste below code at the bottom of the file:

 

@media (min-width: 768px) { [id^="MainProduct-template"] { --page-width: 1600px !important; } }