u
This commit is contained in:
1 parent
785cc946d2
commit
94983ed1ea
8 files changed
+1432
-1086
No files matched your search
@@ -0,0 +1,94 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>App TabBar</title>
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'Arial', sans-serif;
|
||||
background: #f5f5f5;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
justify-content: flex-end; /* 保证TabBar在底部 */
|
||||
}
|
||||
|
||||
/* TabBar 容器 */
|
||||
.tabbar {
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
background: #fff;
|
||||
border-top-left-radius: 15px;
|
||||
border-top-right-radius: 15px;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
box-shadow: 0 -2px 10px rgba(0,0,0,0.05); /* 轻微阴影 */
|
||||
border-top: 1px solid #eee;
|
||||
}
|
||||
|
||||
/* Tab 按钮 */
|
||||
.tab {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #999;
|
||||
font-size: 12px;
|
||||
text-decoration: none;
|
||||
position: relative;
|
||||
transition: color 0.3s ease;
|
||||
flex: 1; /* 平均分布 */
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
.tab svg {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
margin-bottom: 3px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
/* 高亮效果 */
|
||||
.tab.active {
|
||||
color: #2575fc; /* 选中颜色 */
|
||||
}
|
||||
|
||||
.tab.active svg {
|
||||
transform: scale(1.2);
|
||||
fill: #2575fc;
|
||||
}
|
||||
|
||||
/* 可选:添加底部小圆点高亮 */
|
||||
.tab.active::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: 5px;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
background: #2575fc;
|
||||
border-radius: 50%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="tabbar">
|
||||
<a href="#" class="tab active">
|
||||
<svg fill="currentColor" viewBox="0 0 24 24"><path d="M12 2L2 12h3v8h6v-6h2v6h6v-8h3z"/></svg>
|
||||
首页
|
||||
</a>
|
||||
<a href="#" class="tab">
|
||||
<svg fill="currentColor" viewBox="0 0 24 24"><path d="M12 12c2.21 0 4-1.79 4-4S14.21 4 12 4 8 5.79 8 8s1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>
|
||||
我的
|
||||
</a>
|
||||
<a href="#" class="tab">
|
||||
<svg fill="currentColor" viewBox="0 0 24 24"><path d="M3 6h18v2H3zM3 12h18v2H3zM3 18h18v2H3z"/></svg>
|
||||
菜单
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user