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

Trying to get my banner image to extend edge to edge

Solved

Trying to get my banner image to extend edge to edge

jasminsharp97
Shopify Partner
107 1 33

I'm trying to get the pink banner at the top of this page to extend edge to edge: https://sillygeorge.com/products/pop-on-lashes-single-size

 

This is the code I was trying but for some reason it's not working. What am I missing?

 

#shopify-section-template--24793951437172__image_with_text_overlay_JAdraY .section {
margin-left: 0 !important;
margin-right: 0 !important;
width: 100%!important;
max-width: 100%!important;
}

#shopify-section-template--24793951437172__image_with_text_overlay_JAdraY .shopify-section-wrapper.section {
margin-left: 0 !important;
margin-right: 0 !important;
width: 100%!important;
max-width: 3000px!important;
}

 

Accepted Solution (1)

tim
Shopify Partner
4812 598 1733

This is an accepted solution.

Undo your codes and put this into "Custom CSS" setting of this section:

.banner.full-width--true {
  margin: 0 calc(50% - 50vw);
  width: 100vw;
  max-width: none;
}

When you use "Custom CSS" Shopify will automatically prepend section id selector (which is needed to override some of the existing rules for width and max-width).  This way it both limits the rule to current section only, but also raises it's priority.

 

This technique with negative horizontal margin is called "container break"  and work very nicely with vw measurement units to create full-bleed elements.

If my post is helpful, hit the thumb up button -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com

View solution in original post

Replies 3 (3)

tim
Shopify Partner
4812 598 1733

This is an accepted solution.

Undo your codes and put this into "Custom CSS" setting of this section:

.banner.full-width--true {
  margin: 0 calc(50% - 50vw);
  width: 100vw;
  max-width: none;
}

When you use "Custom CSS" Shopify will automatically prepend section id selector (which is needed to override some of the existing rules for width and max-width).  This way it both limits the rule to current section only, but also raises it's priority.

 

This technique with negative horizontal margin is called "container break"  and work very nicely with vw measurement units to create full-bleed elements.

If my post is helpful, hit the thumb up button -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com
jasminsharp97
Shopify Partner
107 1 33

This worked perfectly, thank you! Is that a concept I can cross apply to other sections on my website I want to go edge to edge (assuming I figure out the section id for the css) or does that only work on that specific banner block?

tim
Shopify Partner
4812 598 1733

No need to find section id -- if you use "Custom CSS" the system will add it automatically.

And yes, you can apply it to other elements just need proper selector.

If my post is helpful, hit the thumb up button -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com