由于我无法实际编写前端代码,但可以给你一个**完整的HTML/CSS模板代码**,你可以直接复制到文本编辑器中保存为`.html`文件运行:
```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>抖音网页版</title>
<style>
* {
margin: 0;
padding: 0;
font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}
body {
background-color: #f8f8f8;
color: #333;
}
/* 顶部导航栏 */
.header {
position: fixed;
top: 0;
width: 100%;
height: 60px;
background: white;
box-shadow: 0 2px 10px rgba(0,0,0,0.05);
display: flex;
align-items: center;
z-index: 100;
}
.logo {
width: 100px;
margin-left: 20px;
}
.search-box {
flex: 1;
max-width: 500px;
margin: 0 20px;
}
.search-box input {
width: 100%;
height: 36px;
border-radius: 18px;
border: 1px solid #eee;
padding: 0 15px;
outline: none;
}
.user-actions {
margin-right: 20px;
}
/* 三栏主体布局 */
.container {
display: flex;
margin-top: 60px;
}
/* 左侧导航 */
.sidebar {
width: 200px;
padding: 20px;
position: fixed;
height: 100%;
}
.nav-item {
padding: 12px 0;
display: flex;
align-items: center;
font-weight: 500;
}
.nav-item img {
margin-right: 10px;
}
/* 视频流 */
.content {
flex: 1;
margin-left: 240px;
margin-right: 340px;
padding: 20px 0;
}
.video-card {
background: white;
border-radius: 8px;
overflow: hidden;
margin-bottom: 20px;
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.video-player {
width: 100%;
height: 600px;
background: #222;
position: relative;
}
.video-info {
padding: 15px;
}
.video-stats {
display: flex;
margin-top: 10px;
}
.stat-item {
display: flex;
align-items: center;
margin-right: 20px;
color: #666;
}
.like.active {
color: #FE2C55;
}
/* 右侧推荐区 */
.recommendations {
width: 300px;
position: fixed;
right: 0;
padding: 20px;
}
.recommend-user {
display: flex;
align-items: center;
margin-bottom: 15px;
}
.avatar {
width: 40px;
height: 40px;
border-radius: 50%;
margin-right: 10px;
}
.follow-btn {
margin-left: auto;
background: #FE2C55;
color: white;
border: none;
padding: 4px 12px;
border-radius: 4px;
font-size: 12px;
}
</style>
</head>
<body>
<!-- 顶部导航 -->
<div class="header">
<img src="https://lf1-cdn-tos.bytegoofy.com/goofy/ies/douyin_web/public/favicon.i…; alt="抖音" class="logo">
<div class="search-box">
<input type="text" placeholder="搜索视频、用户、话题...">
</div>
<div class="user-actions">
<button>上传</button>
<button>消息</button>
<button>个人中心</button>
</div>
</div>
<!-- 主体内容 -->
<div class="container">
<!-- 左侧导航 -->
<div class="sidebar">
<div class="nav-item">
<img src="https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/svg/1f3ac.svg…; width="24"> 首页
</div>
<div class="nav-item">
<img src="https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/svg/1f440.svg…; width="24"> 关注
</div>
<div class="nav-item">
<img src="https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/svg/1f50d.svg…; width="24"> 发现
</div>
<div class="nav-item">
<img src="https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/svg/1f4fa.svg…; width="24"> 直播
</div>
</div>
<!-- 视频流 -->
<div class="content">
<div class="video-card">
<div class="video-player">
<!-- 这里实际应该是video标签 -->
<div style="color:white; text-align:center; line-height:600px;">视频播放区域</div>
</div>
<div class="video-info">
<h3>这是一个示范视频标题</h3>
<p>@用户名 · 这是视频描述内容...</p>
<div class="video-stats">
<div class="stat-item like active">
<span>❤️</span> 2.1w
</div>
<div class="stat-item">
<span>💬</span> 349
</div>
<div class="stat-item">
<span>🔄</span> 分享
</div>
</div>
</div>
</div>
<!-- 更多视频卡片... -->
</div>
<!-- 右侧推荐 -->
<div class="recommendations">
<h3>推荐用户</h3>
<div class="recommend-user">
<img src="https://randomuser.me/api/portraits/women/1.jpg" class="avatar">
<div>
<div>用户A</div>
<small>音乐人</small>
</div>
<button class="follow-btn">关注</button>
</div>
<div class="recommend-user">
<img src="https://randomuser.me/api/portraits/men/1.jpg" class="avatar">
<div>
<div>用户B</div>
<small>舞蹈达人</small>
</div>
<button class="follow-btn">关注</button>
</div>
<h3 style="margin-top:30px;">热门话题</h3>
<div style="color:#FE2C55; margin:5px 0;">#挑战你的舞蹈基因</div>
<div style="color:#FE2C55; margin:5px 0;">#美食创作大赛</div>
</div>
</div>
</body>
</html>
```
### 使用说明:
1. 将上方代码复制到文本编辑器(如记事本/VSCode)
2. 保存为 `douyin.html` 文件
3. 用浏览器打开即可看到效果
### 功能扩展建议:
- 添加JavaScript实现视频播放/点赞交互
- 用CSS媒体查询适配移动端
- 替换示例图片为真实资源
需要我解释某个CSS模块的实现逻辑吗?或者你想调整哪个部分的视觉样式?