Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hey Guys! I am having a weird issue with CSS executing properly on Shopify. I am using the code below to have a sizing bar for my clothing store, but no matter what I do the bar doesn't fill when added on my Shopify product pages. When I open the code locally it works perfectly but not on Shopify, I tried adding it as a custom liquid section, and adding it to the liquid files, and it doesn't seem like a conflicting styles issue because the classes are completely unique. What do you think this issue is? (code & images below)
Code:
<div class="size-guide-container"> <span class="guide-title">Fitment Guide</span> <div class="guide-bar-bg"> <div class="guide-bar-fill" style="width: 65%;"></div> </div> <div class="guide-labels"> <span>Fits Small</span> <span>True to Size</span> <span>Oversized</span> </div> </div> <style> .size-guide-container { display: flex; flex-direction: column; gap: 12px; margin-top: 32px; margin-bottom: 12px; width: 100%; } .guide-title { font-size: 1rem; font-weight: 800; } .guide-bar-bg { width: 100%; background-color: #A0AEC0; border-radius: 8px; height: 8px; position: relative; } .guide-bar-fill { height: 8px; background-image: linear-gradient(to right, #9F7AEA, #7B3ED8); border-radius: 8px; position: absolute; top: 0; left: 0; } .guide-labels { display: flex; justify-content: space-between; align-items: center; font-size: 0.875rem; font-weight: 700; width: 100%; } </style>
Locally:
On Shopify Product Page:
Solved! Go to the solution
This is an accepted solution.
Hi @Ciaranmci27
Please update your code to this
<div class="size-guide-container">
<span class="guide-title">Fitment Guide</span>
<div class="guide-bar-bg">
<div class="guide-bar-fill" style="width: 65%;"></div>
</div>
<div class="guide-labels">
<span>Fits Small</span>
<span>True to Size</span>
<span>Oversized</span>
</div>
</div>
<style>
.size-guide-container {
display: flex;
flex-direction: column;
gap: 12px;
margin-top: 32px;
margin-bottom: 12px;
width: 100%;
}
.guide-title {
font-size: 1rem;
font-weight: 800;
}
.guide-bar-bg {
width: 100%;
background-color: #A0AEC0;
border-radius: 8px;
height: 8px;
position: relative;
}
.guide-bar-fill {
display: block !important;
height: 8px;
background-image: linear-gradient(to right, #9F7AEA, #7B3ED8);
border-radius: 8px;
position: absolute;
top: 0;
left: 0;
}
.guide-labels {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 0.875rem;
font-weight: 700;
width: 100%;
}
</style>
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...Sign up now.
Hi @Ciaranmci27
Could you send product page link to check?
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...Sign up now.
Here is a URL: https://racegallery.co/products/test-products
The website password is "race". Thank you for your help!
This is an accepted solution.
Hi @Ciaranmci27
Please update your code to this
<div class="size-guide-container">
<span class="guide-title">Fitment Guide</span>
<div class="guide-bar-bg">
<div class="guide-bar-fill" style="width: 65%;"></div>
</div>
<div class="guide-labels">
<span>Fits Small</span>
<span>True to Size</span>
<span>Oversized</span>
</div>
</div>
<style>
.size-guide-container {
display: flex;
flex-direction: column;
gap: 12px;
margin-top: 32px;
margin-bottom: 12px;
width: 100%;
}
.guide-title {
font-size: 1rem;
font-weight: 800;
}
.guide-bar-bg {
width: 100%;
background-color: #A0AEC0;
border-radius: 8px;
height: 8px;
position: relative;
}
.guide-bar-fill {
display: block !important;
height: 8px;
background-image: linear-gradient(to right, #9F7AEA, #7B3ED8);
border-radius: 8px;
position: absolute;
top: 0;
left: 0;
}
.guide-labels {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 0.875rem;
font-weight: 700;
width: 100%;
}
</style>
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...Sign up now.
Hi, @Ciaranmci27,
Follow These Steps.
Goto Online store > Assets > Edit code > find Base.css File and paste the code mentioned below.
.size-guide-container {
display: flex;
flex-direction: column;
gap: 12px;
margin-top: 32px;
margin-bottom: 12px;
width: 100%;
}
.guide-title {
font-size: 1rem;
font-weight: 800;
}
.guide-bar-bg {
width: 100%;
background-color: #A0AEC0;
border-radius: 8px;
height: 8px;
position: relative;
}
.guide-bar-fill {
height: 8px;
background-image: linear-gradient(to right, #9F7AEA, #7B3ED8);
border-radius: 8px;
position: absolute;
top: 0;
left: 0;
}
.guide-labels {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 0.875rem;
font-weight: 700;
width: 100%;
}
If I managed to help you then, don't forget to Like it and Mark it as Solution!
Best Regards,
Websensepro
Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025