'How to resize 2 embedded elements side by side together with the page size?
How do I embed these side by side and make them also resize with the page so that the video takes up about 70% of the left side of the page and the chat takes up the other 30%?
I also want them to resize as a group with the page so it always looks nice.
I am somewhat new to HTML and CSS, I appreciate any help from the pros.
<div class="topnav">
<a href="index.html">Home</a>
<a class="active" href="watch.html">Watch</a>
<a href="https://pushpay.com/g/southknoxvillechurchofgod" target="_blank">Give</a>
<a href="events.html">Events</a>
</div>
<div style="padding:56.25% 0 0 0;position:relative;"><iframe src="https://vimeo.com/event/1736206/embed" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen style="position:absolute;top:0;left:0;width:100%;height:100%;"></iframe></div>
<iframe src="https://vimeo.com/event/1736206/chat/" width="100%" height="100%" frameborder="0"></iframe>
Solution 1:[1]
Wrap the video and chat inside a flexbox container and customize the width for the video and chat separately. See the snippet below for your reference:
.container {
display: flex;
}
.video-container {
width: 70%;
}
.chat-container {
width: 30%;
}
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Watch</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/watch.css">
</head>
<body>
<div class="topnav">
<a href="index.html">Home</a>
<a class="active" href="watch.html">Watch</a>
<a href="https://pushpay.com/g/southknoxvillechurchofgod" target="_blank">Give</a>
<a href="events.html">Events</a>
</div>
<div class="container">
<div class="video-container" style="padding:56.25% 0 0 0;position:relative;"><iframe src="https://vimeo.com/event/1736206/embed" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen style="position:absolute;top:0;left:0;width:100%;height:100%;"></iframe></div>
<iframe class="chat-container" src="https://vimeo.com/event/1736206/chat/" frameborder="0"></iframe>
</div>
</body>
</html>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Yong |
