html - 使用 CSS 垂直对齐 HTML 面板
问题描述
我正在尝试将表单垂直放置在画布内。我有两个面板,当它们设置为绝对时,我希望它们放置在页面的右侧(但占用相同的空间)。复杂之处在于面板顶部有折叠按钮,因此硬编码偏移量将不起作用(当上层折叠时,我需要下层向上移动)。
我的表单 CSS 如下:
#properties-tab {
position: absolute;
display: inline;
top: 16px;
right: 20px;
width: 20%;
text-align: center;
z-index: 101;
display: block;
background-color: #9e9a90;
background: rgba(0, 0, 0, 0.1);
border-top-left-radius: 6px;
border-top-right-radius: 6px;
border: 0;
}
#tag-tab {
position: absolute;
display: inline;
top: 16px;
right: 20px;
width: 20%;
text-align: center;
z-index: 101;
display: block;
background-color: #9e9a90;
background: rgba(0, 0, 0, 0.1);
border-top-left-radius: 6px;
border-top-right-radius: 6px;
border: 0;
}
按钮上的 CSS 如下所示:
#job-info {
position: absolute;
display: inline;
top: 34px;
right: 20px;
width: 20%;
text-align: center;
z-index: 101;
display: block;
background-color: #9e9a90;
background: rgba(0, 0, 0, 0.1);
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
}
#tag-info {
position: absolute;
display: inline;
top: 34px;
right: 20px;
width: 20%;
text-align: center;
z-index: 101;
display: block;
background-color: #9e9a90;
background: rgba(0, 0, 0, 0.1);
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
}
使用上面的代码放置,它看起来像这样:
当我将设置更改为相对时,会发生这种情况:
任何帮助,将不胜感激。
解决方案
推荐阅读
- ssas - OLAP 多维数据集中的维度的 NullProcessing 属性在哪里?
- c# - 当我从 Web 打开 Excel 文档时,无法重新调整 Excel 的 ctrl+s 事件的用途
- javascript - 将 json 对象从 jquery 发送到 angularjs 并使用 ng-repeat
- vba - 让 Outlook Redemption 在 64 位操作系统上运行?
- spring - 如何使用 Spring Boot “即时”连接到 postgresql 数据库
- php - 如何在php中对数字进行排序?
- postgresql - PostgreSQL C 函数:libpq 不链接?
- r - 如何读取闪亮的 xls?R-工作室
- python - 如何使用 python 从 EPS 或 GIF 图像中提取元数据
- microsoft-graph-api - 不再返回新组属性的组的增量查询