gpt4 book ai didi

css - 具有 3 个常规列和 1 个垂直旋转的四列 div

转载 作者:行者123 更新时间:2023-11-28 05:07:01 26 4
gpt4 key购买 nike

我正在尝试制作一个包含 4 列的 div

  1. 第一个应该垂直旋转。其中的文本应垂直和水平居中。它还应具有背景和 10% 的宽度。
  2. 其余列(2、3、4)的宽度应为 30%。

enter image description here最好的方法是什么?

附言当然,div 应该是响应式的,并且在任何分辨率下都应该看起来不错。

最佳答案

请记住,如果其他 div(30% 宽度内容太少),则需要添加最小高度或高度。在我的例子中,我添加了 300px;

.flex {
display: flex;
}

.flex-center-all {
display: flex;
justify-content: center;
align-items: center;
width: 10%;
background: green;
min-height: 300px;
}

.rotate {
transform: rotate(90deg);
}

.container {
width: 100%;
}

.container > div:not(.flex-center-all) {
width: 30%;
}
<div class="flex container">
<div class="flex-center-all">
<div class="rotate">rotate</div>
</div>
<div>text <br> txt</div>
<div>text</div>
<div>text</div>
</div>

关于css - 具有 3 个常规列和 1 个垂直旋转的四列 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39786849/

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