gpt4 book ai didi

html - 如何用另一个元素填充元素的右侧?

转载 作者:太空宇宙 更新时间:2023-11-04 09:48:27 25 4
gpt4 key购买 nike

这是我的代码:

.parent{
direction: rtl;
border: 2px solid;
background-color: #eee;
height: 50%;
}

.full_height{
height: 100%;
background-color: red;
}

.full_width1, .full_width2{
width: 100%;
background-color: green;
}
<div class="parent">
<div class="full_height"></div>
<div class="full_width1">something1</div>
<div class="full_width2">something2</div>
</div>

这是预期的输出:

enter image description here

我该如何实现?

最佳答案

可能的解决方案如下所示:

html, body{
height: 100%;
margin: 0;
padding: 0;
}
.parent{
direction: rtl;
border: 2px solid;
background-color: #eee;
height: 50%;
overflow: hidden;
}
.full_height{
float: right;
height: 100%;
width: 120px;
background-color: red;
}
.full_width1, .full_width2{
min-width: 120px;
height: 50%;
width: auto;
overflow: hidden;
background-color: green;
}
.full_width2{
background-color: blue;
}

您可以在此处找到 fiddle 预览:https://jsfiddle.net/7pb8pxnx/2/

关于html - 如何用另一个元素填充元素的右侧?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39302426/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com