我试图制作嵌入我的twitch.tv流和聊天的网站。根据可用空间调整元素的大小,同时保持比例
我希望将聊天固定到页面的特定宽度并使用其所有垂直空间。而实际的流使用剩余的水平空间,同时保持相同的宽高比,所以没有任何黑色边框。
以下基本教程后,这是我想出了这么远:
<html>
<head>
<title>Twitch Stream</title>
<style type="text/css">
#chat {
float:left;
width:350px;
height:100%;
background-color:#ff0000;
}
#stream {
position:fixed;
float:right;
width: 100%;
background-color:#00FF00;
}
</style>
</head>
<body>
<div>
<iframe id="chat" src="http://www.twitch.tv/twitch/chat?popout=" frameborder="0" scrolling="no" height="500" width="350"></iframe>
<iframe id="stream" src="http://www.twitch.tv/twitch/embed" frameborder="0" scrolling="no" height="378" width="620"></iframe>
</div>
</body>
</html>
林可能要对这个错误的方式,任何帮助,将建议
我更新了我的答案。你可以看看 – Trix