I know there’s a lot of posts on this already, but I have read them all, and none seem to quite get it right…
I am trying to embed a responsive YouTube video which I have done. On mobile it takes up the full-width and looks good, however on the desktop version it does the same and this makes it MASSIVE.
How can I fix this.
Current code:
P.S. I am inserting this inside of the Shopify custom liquid field.
I have tried all kinds of different generators, as well as adding another div around it and trying to adjust the padding etc. but I couldn’t seem to get that to work (I am no wed developer).
Hi, I see you got no response. I’m looking for help for this also please. On my blog post (at the bottom of the page), the video is responsive but not at the same width as the blog images. Would you be able to provide me with a code that displays the YouTube video at the same width as the image, whilst maintaining a 16:9 ratio for the video?
thanks for your solution! I had the same issue and it almost worked for me, player width now is the same as the blog text container and its responsive on both pc and mobile, but the height is smaller and so the aspect ratio of the player is not 16:9 and you can see black borders on the sides if you play video not in full screen (blog post ).
I’m using Craft theme and here is the code I put in base.css: