gpt4 book ai didi

html - 如何使div的高度相同看下面

转载 作者:行者123 更新时间:2023-11-28 08:14:26 25 4
gpt4 key购买 nike

请看下图http://i.stack.imgur.com/uhhE9.png我曾尝试创建类似的设计,但它有一些问题,例如当您的元素小于 4 时,它显示当前在我添加的 fiddler 下方的一些空白.p-group { line-height: 6.2; 不适合 2 项或超过 4 项,有人建议我使用列表项 ul li

.p {
overflow: hidden;
width: 100%;
}
.p-left {
float: left;
/*background:#fdd;*/
}
.test {
float: left;
background: #acacac;
color: white;
font-family: "Century Gothic";
font-size: 14px;
}
.test:hover {
cursor: pointer;
background: #2F7AC6;
}
.ht {
min-height: 180px;
}
.p-group {
margin-top: 5px;
-ms-transform: rotate(270deg); /* IE 9 */
-moz-transform: rotate(270deg); /* Firefox */
-webkit-transform: rotate(270deg); /* Safari and Chrome */
-o-transform: rotate(270deg); /* Opera */
overflow: hidden;
}
.p-right {
border: 1px solid #efefef;
color: white;
overflow: hidden;
width: 75%;
}
.p-item {
float: left;
width: 100px;
}
.a-left {
overflow: hidden;
}
.p-item div {
border: 1px solid white;
background: #cacaca;
color: white;
font-family: "Century Gothic";
font-size: 14px;
padding: 2px;
}
.p-item div:hover {
background: #428ad2;
cursor: pointer;
}
<div class="p">
<div class="p-left">
<div class="a-left">
<div class="test"><div class="p-group">Group</div></div>
<div class="p-item">
<div>A</div>
<div>B</div>
<div>C</div>
<div>D</div>
</div>
</div>
<div class="a-left">
<div class="test"><div class="p-group">Group</div></div>
<div class="p-item">
<div>A</div>
<div>B</div>
<div>C</div>
<div>D</div>
</div>
</div>
</div>
<div class="p-right">
<div class="ht"></div>
</div>

http://jsfiddle.net/Ldym8w78/17/

最佳答案

请检查这个 fiddle http://jsfiddle.net/966naq5e/18/或代码

.p{
width: 100%;
display: table;
table-layout: fixed;
}
.p-left{
display: table-cell;
width: 200px;
background: #333;

padding: 10px; color: #fff;
}
.p-right{
display: table-cell;
background: #666;
}
<div class="p">
<div class="p-left">
<div class="a-left">
<div class="test"><div class="p-group">Group</div></div>
<div class="p-item">
<div>A</div>
<div>B</div>
<div>C</div>
<div>D</div>
<div>A</div>
<div>B</div>
<div>C</div>
<div>D</div>
</div>
</div>
<div class="a-left">
<div class="test"><div class="p-group">Group</div></div>
<div class="p-item">
<div>A</div>
<div>B</div>
<div>C</div>
<div>D</div>
</div>
</div>
</div>
<div class="p-right">
<div class="ht"></div>
</div>

关于html - 如何使div的高度相同看下面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29077441/

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