【发布时间】:2021-04-05 07:39:54
【问题描述】:
我希望右侧的表格触顶
我的标记和 CSS
.leftDev {
float: left;
width: 49%;
padding: 10px;
}
.vl {
border-left: 4px solid blue;
position: absolute;
height: 100%;
float: center;
left: 50%;
top: 0;
height: 100%;
}
.rightDev {
height: 100%;
top: 0%;
float: right;
width: 49%;
padding: 10px;
margin-left: auto;
}
<div class="leftDev"></div>
<div class="vl"></div>
<div class="rightDev "></div>
我保留了top:0;,它仍然在表格下方。帮助到达桌子顶部。
【问题讨论】:
-
能否提供html和css的完整代码?
-
leftDev 包含表单。 VL = 垂直线。 rightDev 包含表
-
我真的很想帮助您解决问题,但您提供的代码仍然不足以重现问题。
-
如果您尝试仅使用您提供的代码,并添加一个简单的表格和边框 = 2 的表格,也许您将能够理解为什么表格在中间。
-
我添加了,但它说“看起来您的帖子主要是代码;请添加更多详细信息。”
标签: css html-table position css-float