Remove border outline on section

Topic summary

A user encountered unwanted light gray border outlines on image and text sections in their Shopify store and sought removal guidance.

Solution Provided:
Multiple experts offered nearly identical solutions:

  • Navigate to Online Store β†’ Themes β†’ Edit Code
  • Locate the theme.liquid file
  • Insert custom CSS code above the </head> tag to remove borders

CSS Approaches:

  • Mobile-only fix: Target .product-media-container with border: 0 using media query @media only screen and (max-width: 749px)
  • Universal fix: Apply border removal without media queries for both desktop and mobile
  • Alternative: Add code in main.css (or base.css/style.css) at the bottom

Key Steps:

  1. Access theme code editor
  2. Find theme.liquid
  3. Paste provided CSS snippet before closing </head> tag
  4. Save changes

All respondents included screenshots demonstrating the before/after results and requested the user mark helpful responses as solutions.

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

My image + text sections have a light gray outline border. How do I remove this?

Here is the store link: https://nattlig.no/products/nattligputen

Here is a screenshot:

3 Likes
  • Here is the solution for you @Nattlig
  • Please follow these steps:

  • Then find the theme.liquid file.
  • Then add the following code at the before tag and press β€˜Save’ to save it.

  • Here is the result you will achieve:

  • Please press β€˜Like’ and mark it as β€˜Solution’ if you find it helpful. Thank you.

Hey @Nattlig

Follow these Steps:

  1. Go to Online Store

  2. Edit Code

  3. Find theme.liquid file

  4. Add the following code in the bottom of the file above tag


RESULT:

If I managed to help you then, don’t forget to Like it and Mark it as Solution!

Best Regards,
Moeed

Step 1: Go to Shopify Admin β†’ Online Store ->Theme β†’ Edit code

Step 2: Search file theme.liquid

Step 3: Insert this code above tag:


Result:

Hi @Nattlig

is this for mobile only? For the mobile:

From you Admin page, go to Online Store > Themes

Select the theme you want to edit

Under the Asset folder, open the main.css(base.css, style.css or theme.css)

Then place the code below at the very bottom of the file.

@media only screen and (max-width: 749px){
.product-media-container.media-type-image.media-fit-cover.global-media-settings {
    border: 0;
}
}

And Save.

For both mobile and dekstop:

Same Instruction.

.product-media-container.media-type-image.media-fit-cover.global-media-settings {
    border: 0;
}

And save.

result:

Please don’t forget to Like and Mark Solution to the post that helped you. Thanks!

Hi @Nattlig

This is Richard 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,

Richard | PageFly