I'm new to CSS and I'm trying to incorporate an animated GIF as a smartphone screen using Bootstrap to ensure responsiveness. I've managed to get it working for larger and medium screens, but the issue arises when resizing for smaller displays.
For reference, here is my attempt on CodePen (https://codepen.io/anon/pen/yGddKK) where you can see the problem specifically on small screens. Additionally, I've attached a screenshot taken outside of CodePen (https://i.sstatic.net/972nr.jpg).
Below is the crucial part of the code:
<div class="container position-relative">
<img class="gif position-absolute img-fluid d-block mx-auto my-auto" src="mygif.gif" alt="">
<img class="img-fluid d-block mx-auto my-auto" src="phone.png" alt="">
</div>
I would greatly appreciate any insights or assistance in understanding why the display breaks on small screens. Thank you in advance!