<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
background-color: #fefefe;
}
/* 表格信息 */
#tableList {
width: 90%;
margin: auto;
left: 0;
top: 0;
right: 0;
bottom: 0;
margin-top: 150px;
}
.tableList_item {
width: 100%;
height: 75px;
line-height: 75px;
margin: 0 auto;
display: flex;
}
.tableList_item:first-child {
border-radius: 30px 30px 0 0;
}
.tableList_item:last-child {
border-radius: 0 0 30px 30px;
}
/* 奇偶颜色 */
.odd {
background-color: rgba(239, 243, 255, 1);
}
.even {
background-color: rgba(248, 249, 255, 1);
}
/* 名称 */
.tableList_name {
width: 45%;
padding-left: 29px;
font-size: 27px;
color: rgba(0, 0, 0, 1);
}
/* 值 */
.tableList_value {
text-align: center;
width: 35%;
font-size: 30px;
font-weight: 500;
color: rgba(0, 0, 0, 1);
}
/* 范围 */
.tableList_value_unit {
color: #b3b2b2;
}
.tableList_area {
text-align: center;
width: 30%;
}
/* tooltip提示 */
[tooltip] {
position: relative;
display: inline-block;
}
/* 小箭头 */
[tooltip]::before {
content: "";
position: absolute;
border-width: 4px 6px 0 6px;
border-style: solid;
border-color: transparent;
border-top-color: black;
z-index: 99;
opacity: 0;
top: -5px;
left: 27%;
transform: translateX(-50%);
}
/* 提示框 */
[tooltip]::after {
content: attr(tooltip);
position: absolute;
background: black;
text-align: center;
color: #fff;
border-radius: 5px;
padding: 4px 8px;
/* 宽度由内容决定 */
width: max-content;
font-size: 24px;
/* 让事件传递给下面的元素 */
pointer-events: none;
z-index: 99;
opacity: 0;
left: 50%;
top: -5px;
transform: translateX(-77%) translateY(-100%);
}
[tooltip]:hover::after,
[tooltip]:hover::before {
animation-name: fade;
animation-duration: 3s;
}
@keyframes fade {
0% {
opacity: 1;
}
80% {
opacity: 1;
}
100% {
opacity: 0;
}
}
</style>
</head>
<body>
<div id="tableList">
<div class="tableList_item odd">
<div tooltip="呼气峰流值" class="tableList_name">
PEF<span class="tableList_value_unit">(L/s)</span>
</div>
<div class="tableList_value" id="tableList_value_PEF">--</div>
</div>
<div class="tableList_item even">
<div tooltip="用力呼气量" class="tableList_name">
FVC<span class="tableList_value_unit">(mL)</span>
</div>
<div class="tableList_value" id="tableList_value_FVC">--</div>
</div>
<div class="tableList_item odd">
<div tooltip="0.5s用力呼气的容积" class="tableList_name">
FEV0.5<span class="tableList_value_unit">(L)</span>
</div>
<div class="tableList_value" id="tableList_value_FEV0.5">
--
</div>
</div>
<div class="tableList_item even">
<div tooltip="1s用力呼气的容积" class="tableList_name">
FEV1<span class="tableList_value_unit">(L)</span>
</div>
<div class="tableList_value" id="tableList_value_FEV1">--</div>
</div>
<div class="tableList_item odd">
<div tooltip="75%肺活量的呼气速度" class="tableList_name">
FEF75<span class="tableList_value_unit">(L/s)</span>
</div>
<div class="tableList_value" id="tableList_value_FEF75">--</div>
</div>
<div class="tableList_item even">
<div tooltip="25%肺活量的呼气速度" class="tableList_name">
FEF25<span class="tableList_value_unit">(L/s)</span>
</div>
<div class="tableList_value" id="tableList_value_FEF25">--</div>
</div>
<div class="tableList_item odd">
<div tooltip="最大呼气中段流量" class="tableList_name">
FEF2575<span class="tableList_value_unit">(L/s)</span>
</div>
<div class="tableList_value" id="tableList_value_FEF2575">
--
</div>
</div>
<div class="tableList_item even">
<div tooltip="最大呼气压" class="tableList_name">
MEP<span class="tableList_value_unit">(kPa)</span>
</div>
<div class="tableList_value" id="tableList_value_MEP">--</div>
</div>
</div>
<script>
console.log(["Hello 笔.COOL 控制台"])
</script>
</body>
</html>
index.html
index.html