.video-container { position: relative; padding-bottom: 56.25%; /* 16:9 aspect ratio (change to your video's aspect ratio if necessary) */ padding-top: 0; height: 0; overflow: hidden; max-width: 100%; /* Ensure the video doesn't exceed the width of the screen */ } .video-container iframe, .video-container object, .video-container embed { position: absolute; top: 0; left: 0; width: 100%; /* Set the width to 100% to fit the container */ height: 100%; /* Set the height to 100% to fit the container */ }
Copyright © 2023, Ahmad Hammoud