简化版京东首页,可以参考框架

<!DOCTYPE html>
<html lang="zh">
<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: #f5f5f5;
        }

        .container {
            width: 1200px;
            margin: 0 auto;
            padding: 20px;
        }

        header {
            background-color: #ff5733;
            color: white;
            padding: 10px 0;
        }

        header h1 {
            margin: 0;
            text-align: center;
        }

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

        nav ul li {
            display: inline-block;
        }

        nav ul li a {
            color: white;
            text-decoration: none;
            padding: 10px 20px;
            border-radius: 5px;
            transition: background-color 0.3s ease;
        }

        nav ul li a:hover {
            background-color: rgba(255, 255, 255, 0.2);
        }

        .main-content {
            display: flex;
            flex-wrap: wrap;
        }

        .product {
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
            margin: 10px;
            padding: 10px;
            background-color: white;
            width: calc(25% - 20px); /* 假设每行4个产品,所以每个产品宽度是25%减去两边margin */
        }

        .product img {
            width: 100%;
            height: auto;
            display: block;
            margin-bottom: 10px;
        }

        .product h2 {
            margin: 0;
        }

        .product p {
            margin: 5px 0;
        }

        footer {
            background-color: #333;
            color: white;
            text-align: center;
            padding: 20px;
            position: fixed;
            bottom: 0;
            width: 100%;
        }
    </style>
</head>
<body>
    <header>
        <div class="container">
            <h1>简化版京东首页</h1>
        </div>
    </header>

    <nav>
        <div class="container">
            <ul>
                <li><a href="#">首页</a></li>
                <li><a href="#">手机数码</a></li>
                <li><a href="#">家用电器</a></li>
                <li><a href="#">服装鞋包</a></li>
            </ul>
        </div>
    </nav>

    <div class="container">
        <div class="main-content">
            <div class="product">
                <img src="product1.jpg" alt="Product 1">
                <h2>产品名称 1</h2>
                <p>产品价格 1</p>
            </div>
            <div class="product">
                <img src="product2.jpg" alt="Product 2">
                <h2>产品名称 2</h2>
                <p>产品价格 2</p>
            </div>
            <!-- 更多产品 -->
        </div>
    </div>

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值