web前端作业--响应式美食菜谱网页设计(HTML+CSS+JavaScript+)实现

原始HTML+CSS+JS页面设计, web大学生网页设计作业源码,这是一个不错的美食菜谱网页设计制作,非常适合初学者学习使用。

网页实现截图:文末获取源码

网站首页:
在这里插入图片描述
菜谱:
在这里插入图片描述
美食达人:
在这里插入图片描述

手机版效果:

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

主要源码结构:

在这里插入图片描述

主要源码展示:

index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>HTML5响应式美食网站模板</title>
    <link rel="stylesheet" href="./css/bootstrap.min.css">
    <link rel="stylesheet" href="./css/index.css">
    <script src="./js/jquery-1.10.2.min.js"></script>
    <script src="./js/bootstrap.min.js"></script>
</head>
<body>
    <!-- 导航栏 -->
    <div class="container">
        <nav class="navbar navbar-expand-md bg-smare  navbar-dark mt-0">
            <button class="navbar-toggler" data-toggle="collapse" data-target="#navbar">
                <span class="navbar-toggler-icon"></span>
            </button>
            <!-- logo -->
            <a href="#" class="navbar-brand">
                <img src="https://localhost:9000/preview/element/00/01/26/30/E-1263083-6FC2F3D2.jpg!/quality/90/unsharp/true/compress/true/format/jpg/fh/320" alt="" width="30"
                    class="align-top" style="border-radius: 50%;"> 美食霸王餐
            </a>
            <div class="collapse navbar-collapse" id="navbar">
                <ul class="navbar-nav mr-auto">
                    <li class="nav-item"><a href="index.html" class="nav-link">首页</a></li>
                    <li class="nav-item"><a href="menu.html" class="nav-link">菜谱</a></li>
                    <li class="nav-item"><a href="foodie.html" class="nav-link">美食达人</a></li>
                </ul>
                <form action="#" class="form-inline">
                    <input type="search" class="form-control mr-sm-2" placeholder="Search">
                    <!-- <button type="submit" class="btn btn-outline-success mt-2 mt-sm-0">Search</button> -->
                </form>
            </div>
        </nav>
    </div>
    <!-- 页面内容 -->
    <div class="data-content">
      <div class="part-1">
          <div class="left">
              <div class="hot">
                  <h1 class="title">今日热搜</h1>
                  <div class="hotlist">
                      <span class="active">可乐鸡翅</span>
                      <span class="active">红烧排骨</span>
                      <span class="active">糖醋排骨</span>
                      <span>清蒸鲈鱼</span>
                      <span>空气炸锅</span>
                      <span>油焖大虾</span>
                      <span>麻辣小龙虾</span>
                      <span>蒜蓉小龙虾</span>
                  </div>
              </div>
              <div class="sancan">
                <h1 class="title">
                    今日三餐
                    <ul class="sancan_tab">
                        <li class="current">早餐</li>
                        <li>午餐</li>
                        <li>下午茶</li>
                        <li>晚餐</li>
                        <li>夜宵</li>
                    </ul>
                </h1>
                <div class="sancan_w">
                    <!-- 早餐 -->
                    <div class="sancan-swiper-slide">
                        <div class="sancan_item">
                            <div class="imgw" style="background:url(https://localhost:9000/r/98/64/10016098/s10016098_152224196314585.jpg?imageMogr2/gravity/Center/crop/330x330) center no-repeat;background-size:cover;"></div>
                            <strong class="title2">抹茶红豆欧包</strong>
                            <p class="des">营养丰富,早餐最爱</p>
                        </div>
                        <div href="#" class="sancan_item">
                            <div class="imgw" style="background:url(https://localhost:9000/r/51/205/2301301/s2301301_152224208115825.jpg?imageMogr2/gravity/Center/crop/330x330) center no-repeat;background-size:cover;"></div>
                            <strong class="title2">酸奶甜饼</strong>
                            <p class="des">美味营养,吃完元气满满</p>
                        </div>
                        <div href="#" class="sancan_item">
                            <div class="imgw" style="background:url(https://localhost:9000/r/219/162/6603219/s6603219_152229186249055.jpg?imageMogr2/gravity/Center/crop/330x330) center no-repeat;background-size:cover;"></div>
                            <strong class="title2">快手三明治</strong>
                            <p class="des">简单快手,分分钟搞定</p>
                        </div>
                    </div>
                    <!-- 午餐 -->
                    <div class="sancan-swiper-slide">
                        <div class="sancan_item">
                            <div class="imgw" style="background:url(https://localhost:9000/r/208/102/1025708/s1025708_149663916013140.jpg?imageMogr2/gravity/Center/crop/330x330) center no-repeat;background-size:cover;"></div>
                            <strong class="title2">玉米山药炖排骨</strong>
                            <p class="des">色香味俱佳,惊艳味蕾</p>
                        </div>
                        <div href="#" class="sancan_item">
                            <div class="imgw" style="background:url(https://localhost:9000/r/97/227/6681847/s6681847_149663111460194.jpg?imageMogr2/gravity/Center/crop/330x330) center no-repeat;background-size:cover;"></div>
                            <strong class="title2">高考必吃的鲜蒸冬瓜</strong>
                            <p class="des">鲜美入味,好吃到爆</p>
                        </div>
                        <div href="#" class="sancan_item">
                            <div class="imgw" style="background:url(https://localhost:9000/r/208/102/1025708/s1025708_149663051570128.jpg?imageMogr2/gravity/Center/crop/330x330) center no-repeat;background-size:cover;"></div>
                            <strong class="title2">肉末豆腐</strong>
                            <p class="des">营养美味,一吃停不下来</p>
                        </div>
                    </div>
                    <!-- 下午茶 -->
                    <div class="sancan-swiper-slide">
                        <div class
  • 34
    点赞
  • 64
    收藏
    觉得还不错? 一键收藏
  • 99
    评论
好的,以下是一个简单的关于美食响应式网站的HTMLCSS代码示例,仅供参考: HTML代码: ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>美食网站</title> <link rel="stylesheet" href="style.css"> </head> <body> <header> <h1>美食网站</h1> <nav> <ul> <li><a href="#">首页</a></li> <li><a href="#">菜谱分类</a></li> <li><a href="#">最新菜谱</a></li> <li><a href="#">我的收藏</a></li> </ul> </nav> </header> <main> <section class="banner"> <h2>今日推荐</h2> <p>这里是今日推荐的菜品介绍</p> <a href="#">查看详情</a> </section> <section class="categories"> <h2>菜品分类</h2> <ul> <li><a href="#">川菜</a></li> <li><a href="#">粤菜</a></li> <li><a href="#">鲁菜</a></li> <li><a href="#">湘菜</a></li> <li><a href="#">东北菜</a></li> </ul> </section> <section class="recipes"> <h2>最新菜谱</h2> <ul> <li> <a href="#"> <img src="images/recipe1.jpg" alt="菜品1"> <h3>菜品名称1</h3> <p>制作难度:初级</p> <p>制作时间:30分钟</p> </a> </li> <li> <a href="#"> <img src="images/recipe2.jpg" alt="菜品2"> <h3>菜品名称2</h3> <p>制作难度:中级</p> <p>制作时间:1小时</p> </a> </li> <li> <a href="#"> <img src="images/recipe3.jpg" alt="菜品3"> <h3>菜品名称3</h3> <p>制作难度:高级</p> <p>制作时间:2小时</p> </a> </li> </ul> </section> </main> <footer> <p>版权信息</p> </footer> </body> </html> ``` CSS代码: ```css /* 全局样式 */ * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: Arial, sans-serif; background-color: #f5f5f5; color: #333; } /* 头部样式 */ header { background-color: #fff; padding: 20px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); } h1 { font-size: 36px; font-weight: bold; } nav ul { list-style: none; display: flex; } nav li + li { margin-left: 20px; } nav a { color: #333; text-decoration: none; font-size: 18px; font-weight: bold; } /* 主体样式 */ main { max-width: 1200px; margin: 0 auto; padding: 20px; } .banner { background-image: url(images/banner.jpg); background-size: cover; background-position: center; height: 400px; display: flex; flex-direction: column; justify-content: center; align-items: center; color: #fff; text-align: center; } .banner h2 { font-size: 48px; font-weight: bold; margin-bottom: 20px; } .banner p { font-size: 24px; margin-bottom: 40px; } .banner a { background-color: #ff6600; color: #fff; padding: 10px 20px; border-radius: 5px; font-size: 18px; } .categories { margin-top: 40px; } .categories h2 { font-size: 36px; font-weight: bold; margin-bottom: 20px; } .categories ul { list-style: none; display: flex; flex-wrap: wrap; } .categories li + li { margin-top: 20px; margin-left: 20px; } .categories a { background-color: #fff; color: #333; padding: 10px 20px; border: 1px solid #ccc; border-radius: 5px; font-size: 18px; } .recipes { margin-top: 40px; } .recipes h2 { font-size: 36px; font-weight: bold; margin-bottom: 20px; } .recipes ul { list-style: none; display: flex; flex-wrap: wrap; } .recipes li { width: calc(100% / 3 - 20px); margin-right: 20px; margin-bottom: 20px; } .recipes li:last-child { margin-right: 0; } .recipes a { display: block; background-color: #fff; color: #333; padding: 20px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); border-radius: 5px; font-size: 18px; } .recipes img { max-width: 100%; margin-bottom: 10px; } /* 通用响应式样式 */ @media screen and (max-width: 768px) { .banner { height: 200px; } .banner h2 { font-size: 36px; } .banner p { font-size: 18px; margin-bottom: 20px; } .banner a { font-size: 16px; padding: 5px 10px; } .categories h2 { font-size: 24px; } .categories li + li { margin-left: 10px; margin-top: 10px; } .categories a { font-size: 16px; padding: 5px 10px; } .recipes h2 { font-size: 24px; } .recipes li { width: calc(100% / 2 - 10px); margin-right: 10px; margin-bottom: 10px; } .recipes a { font-size: 16px; padding: 10px; } footer { font-size: 14px; text-align: center; padding: 10px; } } @media screen and (max-width: 480px) { .categories li { width: calc(100% / 2 - 10px); margin-right: 10px; margin-bottom: 10px; } .recipes li { width: 100%; margin-right: 0; margin-bottom: 10px; } .recipes a { font-size: 14px; padding: 5px; } footer { font-size: 12px; padding: 5px; } } ``` 以上代码只是一个简单的示例,实际开发中可能需要更多的CSS样式以及JavaScript交互效果。同时,也需要使用图片等资源来丰富网站内容。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值