Why is the video size error occurring on my product page?

Topic summary

A user is experiencing video sizing issues within their product description tab across all device views. The embedded video doesn’t automatically fit the product card dimensions, creating display problems.

Initial Problem:

  • Video not fitting properly in product description area
  • Issues present on both desktop and mobile views

Solution Approach:
PageFly-Victor provides CSS code to be added to the theme.scss file:

  • Targets .product-single__description.rte iframe elements
  • Uses width: fit-content and media queries for responsive sizing

Iterative Fixes:
Multiple code revisions were needed to address:

  • Excessive gaps appearing around the video
  • Mobile view spacing issues
  • Lost padding in description area
  • Different height requirements for various screen widths (max-width: 376px, 400px, 767px)

Latest Code:
The most recent solution includes:

  • Adjusted margins and padding for desktop/mobile
  • Specific height values (180px, 188px) for different mobile breakpoints
  • Width calculations using calc(100% - 5px)
  • Targeting grid layout elements to maintain proper spacing

The discussion remains ongoing as the user continues testing the responsive behavior across devices.

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

Hi guys,

I have an issue with video size in the product description tab , all views!

Thank you

allianceautoproducts.com

allianceautoproducts.com

It must automatically fit the size of the card in all views.

Hi [email removed]Alliance,

You can try this code by following these steps:

Step 1: Go to Online Store->Theme->Edit code.

Step 2: Search file theme.scss or theme.scss.liquid,

Step 3: Paste the below code at bottom of the file → Save

.product-single__description.rte iframe{width:fit-content !important}

Hope my solution works perfectly for you!

Best regards,

Victor | PageFly

Thank you. But there is a not of gap.

Mobile view needs some adjusting too:

you can remove old code and replace it with new code

.product-single__description.rte{
margin-left:-25px !important;
padding-right:0 !important
}   
 .product-single__description.rte iframe{
width:calc(100% - 5px) !important;
height:200px !important
}
@media(max-width:767px){
.product-single__description.rte{
margin-left:-0 !important;
}   
}
@media(max-with:1024px) and (min-width:768px){
.product-single__description.rte iframe{
height:120px !important
}

Gap in mobile view:

please remove the old code and replace the new code

.product-single__description.rte{
margin-left:-25px !important;
padding-right:0 !important
}   
 .product-single__description.rte iframe{
width:calc(100% - 5px) !important;
height:200px !important
}
@media(max-width:767px){
.product-single__description.rte{
margin-left:0 !important;
} 
.product-single__description.rte iframe{
width:100% !important;
}  
div#ProductSection-product-template .grid__item.medium-up--one-third{
padding:0 5px !important
}
}
@media(max-with:1024px) and (min-width:768px){
.product-single__description.rte iframe{
height:120px !important
}

Two things happened:

1- discription padding gone…

2- some gap still there in mobile view

you can replace the old code

@media(max-width:767px){
.product-single__description.rte{
margin-left:0 !important;
} 
.product-single__description.rte iframe{
width:100% !important;
}  
div#ProductSection-product-template .grid__item.medium-up--one-third{
padding:0 5px !important
}
}

by the new code

@media(max-width:767px){
.product-single__description.rte{
margin-left:0 !important;
} 
.product-single__description.rte iframe{
width:100% !important;
}  
div#ProductSection-product-template .grid__item.medium-up--one-third:has(.tabs li:last-child a.active){
padding:0 5px !important
}
}
@media(max-width:400px) and (min-width:376px){
.product-single__description.rte iframe{height:188px !important}
}
@media (max-width:376px){
.product-single__description.rte iframe{height:180px !important}
}