Jump to content

[SOLVED] Responsive youtube video in product description, it's possible?


DARKF3D3

Recommended Posts

On http://embedresponsively.com/ I found a code generator for various media sources such as youtube. However, you have to put the CSS part of the code to the product.css in your themes\<theme name>\css folder:

.embed-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; height: auto; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

The other part can be placed in the description:

<div class='embed-container'><iframe src='http://www.youtube.com/embed/_OQRXv43DbQ' frameborder='0' allowfullscreen></iframe></div>
Edited by zeezuiper (see edit history)
  • Like 2
  • Thanks 2
Link to comment
Share on other sites

  • 3 weeks later...

Hi all,

 

I have a problem with this modification. 

 

If I do insert this: 

<div class='embed-container'><iframe src='http://www.youtube.com/embed/_OQRXv43DbQ' frameborder='0' allowfullscreen></iframe></div>

everything is OK.

 

If I do insert code to product.css

.embed-container { 
position: relative; 
padding-bottom: 56.25%; 
height: 0; 
overflow: hidden; 
max-width: 100%; 
height: auto; } 

.embed-container iframe, .embed-container object, .embed-container embed { 
position: absolute; 
top: 0; left: 0; 
width: 100%; 
height: 100%; }

distorts my page with a description of the product. 

Before and after the description of there is a gap as large as video (see attachment)

 

Any idea how to modify the css code?

 

Thanks

 

Jaroslav

 

youtube_code.png

Edited by JaroslavH (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
  • 4 weeks later...
×
×
  • Create New...