Files
workspace/code/container-ocr/ocr-vue/test.html
T
2026-03-19 22:15:36 +08:00

102 lines
2.3 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>自适应 Descriptions 每行自动填满</title>
<style>
body {
font-family: Arial, sans-serif;
padding: 20px;
}
/* 每行一个 grid 容器 */
.row {
display: grid;
border-top: 1px solid #ccc;
border-left: 1px solid #ccc;
margin-bottom: 10px;
gap: 0;
/* 紧凑像表格 */
}
/* item 样式 */
.item {
display: flex;
border-right: 1px solid #ccc;
border-bottom: 1px solid #ccc;
min-height: 40px;
}
.label {
flex: 0 0 100px;
/* label 固定宽度 */
background-color: #e0f7fa;
font-weight: bold;
display: flex;
align-items: center;
justify-content: center;
border-right: 1px solid #ccc;
}
.value {
flex: 1;
background-color: #fff9c4;
display: flex;
align-items: center;
justify-content: center;
}
/* 响应式:小屏幕每个 item 占满整行 */
@media (max-width: 500px) {
.row {
grid-template-columns: 1fr !important;
}
}
</style>
</head>
<body>
<h2>自适应 Descriptions 示例</h2>
<!-- 第一行 2 列 -->
<div class="row" style="grid-template-columns: repeat(2, 1fr);">
<div class="item">
<span class="label">姓名:</span>
<span class="value">张三</span>
</div>
<div class="item">
<span class="label">年龄:</span>
<span class="value">18</span>
</div>
</div>
<!-- 第二行 1 列 -->
<div class="row" style="grid-template-columns: repeat(1, 1fr);">
<div class="item">
<span class="label">邮箱:</span>
<span class="value">zhangsan@example.com</span>
</div>
</div>
<!-- 第三行 3 列 -->
<div class="row" style="grid-template-columns: repeat(3, 1fr);">
<div class="item">
<span class="label">城市:</span>
<span class="value">北京</span>
</div>
<div class="item">
<span class="label">职业:</span>
<span class="value">学生</span>
</div>
<div class="item">
<span class="label">爱好:</span>
<span class="value">篮球</span>
</div>
</div>
</body>
</html>