A user published a new theme but is experiencing missing padding/margins on most pages, particularly noticeable on mobile devices. They’re unsure where to add CSS code since their theme lacks a traditional “theme.css” file, though it contains “theme.liquid” and “site.css” under assets.
Proposed Solutions:
Multiple support teams offered CSS fixes:
PageFly-Victor: Add CSS in theme.liquid before the </body> tag targeting .main-content with 15px padding for screens under 767px. This fixed mobile view but not desktop.
EBOOST: Suggested adding code to Assets/site.scss.css targeting .page-width with max-width 1440px and 15px padding.
GemPages: Provided code to insert before </body> in theme.liquid.
Current Issue:
The user needs a solution that applies margins to specific pages (blogs, static pages) while excluding the home page, which displays full-width images. The discussion remains ongoing as they seek page-specific targeting rather than site-wide application. EBOOST confirmed their code only applies to static pages and articles, potentially addressing this concern.
Summarized with AI on November 24.
AI used: claude-sonnet-4-5-20250929.
Hello everyone, I’m hoping someone can help me out. I just published a new theme but on most pages there is no padding/margins on the sides. I’ve attached a screenshot. It looks especially bad on mobile versions.
What code do I need to add and where? If possible, can you give me the code to add if I wanted to change it on the entire website vs individual pages?
Also, I can’t figure out where to add the code. My theme doesn’t have a “theme.css” file. There is a “theme.liquid” under layout and also a “site.css” under assets. So I’m not sure what to edit.
Hi @PageFly-Victor , thank you very much for the reply. This solution seems to have worked for the mobile view, however, on my desktop view there is still no margins. Would it have something to do with the max-width or is it another issue? I need a solution that doesn’t affect or has a small affect the home page because it’s full width images.
Thank you @EBOOST , I will try this solution. How can I distinguish which pages this applies to? Would it be the first line? I don’t want the margins to apply to the home page, but many of the other pages.
@GemPages Thank you! This solution works wonderfully on nearly every page, but it completely ruins the home page. So I think I need a solution were I can apply it to specific pages or somehow get it to ignore the home page.