I am embedding a video (from Vimeo) onto my survey. I am using the embed code from Vimeo which is responsive. It looks great when viewing on my mobile, however when viewing on my laptop it takes up the entire screen.
Is there a way keep it responsive so that when viewed on mobile it stays the same size, but when on laptop it is half the size?
This is the responsive embed code from Vimeo that I am using:
<div style="padding:56.25% 0 0 0;position:relative;"><iframe src="https://player.vimeo.com/video/581420395?badge=0&autopause=0&player_id=0&app_id=58479" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen style="position:absolute;top:0;left:0;width:100%;height:100%;" title="Neck Flexion Test"></iframe></div><script src="https://player.vimeo.com/api/player.js"></script>
Fixed Embed Code:
<iframe src="https://player.vimeo.com/video/581420395?badge=0&autopause=0&player_id=0&app_id=58479" width="1920" height="1080" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen title="Neck Flexion Test"></iframe>
Anytime specific types of devices need to be targeted,
@mediaqueries will do so. Styles of laptop devices can be applied withThis is not an accurate integration. Sizes of screens vary. How to choose breakpoints?
I highly recommend removing properties from the
styleattribute.Interactive Code
Code design is Mobile-first. More information about Using media queries.