【发布时间】:2020-07-20 02:46:48
【问题描述】:
如何将屏幕分成两半,例如:,以便在每一半中添加我的自定义元素?
示例:蓝色一侧是图片,后半部分包含一些随机文本输入
我一直在尝试这样:
<div className={styles.splitScreen}>
<div className={styles.topPane}>
{topPane}
</div>
<div className={styles.bottomPane}>
{bottomPane}
</div>
</div>
使用包含以下内容的 scss 文件:
.splitScreen {
position: relative;
height: 100vh;
.topPane,
.bottomPane {
position: relative;
width: 100%;
height: 50%;
}
.topPane {
transform: rotate(180deg);
}
}
但没有成功。
【问题讨论】:
-
它们应该并排还是一个在另一个之上?
-
@ellitt 并排