如何在HTML和CSS中绘制固定尺寸矩形内的响应矩阵?
我可以在固定大小的整流器内绘制此类内部矩形,但它们没有响应。
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Test div dimension</title>
<style>
#main {
width: 640px;
height: 360px;
border: 1px solid black;
}
#content {
width: 100%;
}
#slide {
border: 1px solid red;
width: calc(640*0.75px);
height: calc(360*0.75px);
float: right;
}
#camera {
border: 1px solid red;
width: calc(640 * 0.25px);
height: calc(360 * 0.25px);
float: left;
}
</style>
</head>
<body>
<div id="main">
<div id="content">
<div id="slide">
Rectange 1
</div>
<div id="camera">
Rectange 2
</div>
</div>
</div>
</body>
</html>
如何在固定尺寸的矩形内创建这种响应式内部直流?
I can draw such inner rectanges inside fixed size rectange but these are not responsive.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Test div dimension</title>
<style>
#main {
width: 640px;
height: 360px;
border: 1px solid black;
}
#content {
width: 100%;
}
#slide {
border: 1px solid red;
width: calc(640*0.75px);
height: calc(360*0.75px);
float: right;
}
#camera {
border: 1px solid red;
width: calc(640 * 0.25px);
height: calc(360 * 0.25px);
float: left;
}
</style>
</head>
<body>
<div id="main">
<div id="content">
<div id="slide">
Rectange 1
</div>
<div id="camera">
Rectange 2
</div>
</div>
</div>
</body>
</html>
How can I create such responsive inner rectanlges inside fixed size rectangle?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
高度:100%;
在#content
中也需要height: 100%;
is also required in#content