用html制作模仿哔哩哔哩视频网页的逻辑示例

该篇文章详细描述了两个版本的HTML和CSS代码,展示了B站网站的页面结构,包括头部、导航栏、不同内容模块(如番剧、国产、综艺等)、搜索框和推广视频,以及特定的样式设计。
摘要由CSDN通过智能技术生成

代码:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>哔哩哔哩</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f4f4f4;
        }

        header {
            background-color: #333;
            color: white;
            padding: 10px;
            text-align: center;
        }

        nav {
            background-color: #eee;
            padding: 10px;
            display: flex;
            justify-content: space-around;
        }

        nav ul {
            list-style-type: none;
            margin: 0;
            padding: 0;
            display: flex;
        }

        nav ul li {
            margin-right: 20px;
        }

        section {
            padding: 20px;
        }

        footer {
            background-color: #333;
            color: white;
            padding: 10px;
            text-align: center;
        }
    </style>
</head>
<body>

<header>
    <h1>哔哩哔哩</h1>
</header>

<nav>
    <ul>
        <li><a href="#promotion">推广模块</a></li>
        
        
        
        <li><a href="#features">功能模块</a></li>
     </ul>
</nav>

<nav>
    <ul>
        
        
        <li><a href="#anime">番剧</a></li>
        <li><a href="#domestic">国产</a></li>
        <li><a href="#variety">综艺</a></li>
        <li><a href="#animation">动画</a></li>
        <li><a href="#mad">鬼畜</a></li>
    </ul>
</nav>


<section id="anime">
    <h2>番剧</h2>
    <!-- 在这里添加番剧模块的内容 -->
    <p>这里是番剧模块的详细信息。</p>
</section>

<section id="domestic">
    <h2>国产</h2>
    <!-- 在这里添加国产模块的内容 -->
    <p>这里是国产模块的详细信息。</p>
</section>

<section id="variety">
    <h2>综艺</h2>
    <!-- 在这里添加综艺模块的内容 -->
    <p>这里是综艺模块的详细信息。</p>
</section>

<section id="animation">
    <h2>动画</h2>
    <!-- 在这里添加动画模块的内容 -->
    <p>这里是动画模块的详细信息。</p>
</section>

<section id="mad">
    <h2>鬼畜</h2>
    <!-- 在这里添加鬼畜模块的内容 -->
    <p>这里是鬼畜模块的详细信息。</p>
</section>

<section id="ad1">
    <h2>推广视频1</h2>
    <!-- 在这里添加推广视频1的内容 -->
    <p>这里是推广视频1的详细信息。</p>
</section>

<section id="ad2">
    <h2>推广视频2</h2>
    <!-- 在这里添加推广视频2的内容 -->
    <p>这里是推广视频2的详细信息。</p>
</section>

<section id="ad3">
    <h2>推广视频3</h2>
    <!-- 在这里添加推广视频3的内容 -->
    <p>这里是推广视频3的详细信息。</p>
</section>

<footer>
    <p>&copy; 2024 哔哩哔哩. All rights reserved.</p>
</footer>

</body>
</html>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>哔哩哔哩</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f4f4f4;
        }

        header {
            background-color: #333;
            color: white;
            padding: 10px;
            text-align: center;
        }

        nav {
            background-color: #eee;
            padding: 10px;
            display: flex;
            justify-content: space-around;
        }

        nav ul {
            list-style-type: none;
            margin: 0;
            padding: 0;
            display: flex;
        }

        nav ul li {
            margin-right: 20px;
        }

        /* 搜索框样式 */
        .search-box {
            display: flex;
            border-radius: 20px;
            overflow: hidden;
        }

        .search-input {
            flex: 1;
            padding: 10px;
            border: none;
            outline: none;
        }

        .search-button {
            background-color: #333;
            color: white;
            padding: 10px;
            border: none;
            border-radius: 0 20px 20px 0;
            cursor: pointer;
        }

        section {
            padding: 20px;
        }

        /* 美化模块样式 */
        .rounded-modules {
            display: flex;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 20px; /* 间隔 */
        }

        .rounded-module {
            width: calc(33.333% - 20px); /* 3 modules in a row with some spacing */
            border: 2px solid #333;
            border-radius: 20px;
            padding: 20px;
            margin-bottom: 20px;
        }

        footer {
            background-color: #333;
            color: white;
            padding: 10px;
            text-align: center;
        }
    </style>
</head>
<body>

<header>
    <h1>哔哩哔哩</h1>
</header>

<nav>
    <ul>
        <!-- 推广模块 -->
        <li>
            <div class="search-box">
                <input type="text" class="search-input" placeholder="搜索">
                <button class="search-button">搜索</button>
            </div>
        </li>
        <!-- 功能模块 -->
        <li>
            <div class="search-box">
                <input type="text" class="search-input" placeholder="搜索">
                <button class="search-button">搜索</button>
            </div>
        </li>
    </ul>
</nav>

<nav>
    <ul>
        <!-- 美化番剧模块 -->
        <li class="rounded-modules">
            <div class="rounded-module">
                <h2>番剧</h2>
                <p>这里是番剧模块的详细信息。</p>
            </div>

            <!-- 美化国产模块 -->
            <div class="rounded-module">
                <h2>国产</h2>
                <p>这里是国产模块的详细信息。</p>
            </div>

            <!-- 美化综艺模块 -->
            <div class="rounded-module">
                <h2>综艺</h2>
                <p>这里是综艺模块的详细信息。</p>
            </div>

            <!-- 美化动画模块 -->
            <div class="rounded-module">
                <h2>动画</h2>
                <p>这里是动画模块的详细信息。</p>
            </div>

            <!-- 美化鬼畜模块 -->
            <div class="rounded-module">
                <h2>鬼畜</h2>
                <p>这里是鬼畜模块的详细信息。</p>
            </div>
        </li>
    </ul>
</nav>

<!-- 页脚 -->
<footer>
    <p>&copy; 2024 哔哩哔哩. All rights reserved.</p>
</footer>

</body>
</html>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>抽象哔哩哔哩</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f4f4f4;
        }

        header {
            background-color: #333;
            color: white;
            padding: 10px;
            text-align: center;
        }

        nav ul {
            list-style-type: none;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: space-between; /* 左右两边对齐 */
            align-items: center; /* 垂直居中 */
            margin-top: 20px;
        }

        .search-box {
            display: flex;
            border-radius: 20px;
            overflow: hidden;
        }

        .search-input {
            flex: 1;
            padding: 10px;
            border: none;
            outline: none;
        }

        .search-button {
            background-color: #333;
            color: white;
            padding: 10px;
            border: none;
            border-radius: 0 20px 20px 0;
            cursor: pointer;
        }

        .extension-module,
        .profile-module {
            padding: 10px;
            background-color: #eee;
            border-radius: 10px;
            flex: 1; /* 新增 */
            text-align: center; /* 新增 */
        }

        section {
            padding: 20px;
        }

        .rounded-modules {
            display: flex;
            justify-content: center;
            flex-wrap: wrap;
            gap: 20px; /* 间隔 */
            margin-top: 20px;
        }

        .rounded-module {
            width: calc(33.333% - 80px); /* 3 modules in a row with some spacing */
            border: 2px solid #333;
            border-radius: 20px;
            padding: 20px;
            margin-bottom: 20px;
            text-align: center;
        }

        footer {
            background-color: #333;
            color: white;
            padding: 10px;
            text-align: center;
            position: fixed;
            bottom: 0;
            width: 100%;
        }
    </style>
</head>
<body>

<header>
    <h1>抽象哔哩哔哩</h1>
</header>

<nav>
    <ul>
        <li class="extension-module">扩展功能</li>
        <li>
            <div class="search-box">
                <input type="text" class="search-input" placeholder="搜索">
                <button class="search-button">前往</button>
            </div>
        </li>
        <li class="profile-module">个人功能</li>
    </ul>
</nav>

<section>
    <div class="rounded-modules">
        <div class="rounded-module">
            <h2>分类 1</h2>
            <p>这里是分类 1 的详细信息。</p>
        </div>

        <div class="rounded-module">
            <h2>分类 2</h2>
            <p>这里是分类 2 的详细信息。</p>
        </div>

        <div class="rounded-module">
            <h2>分类 3</h2>
            <p>这里是分类 3 的详细信息。</p>
        </div>
    </div>
</section>

<footer>
    <p>&copy; 2024 抽象哔哩哔哩. 保留所有权利。</p>
</footer>

</body>
</html>

  • 22
    点赞
  • 23
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值