网页开发——淘宝首页导航

这篇博文主要是重新学习(复习)前端知识,通过写淘宝购物首页导航为案例。

 html主要书写内容:

1.首先我写了一个大盒子,用于存放所用的全部标签

<div class="nav">主要内容 </div>

2.插入一张淘宝网图片 

<img src="./images/tabao.jpg" alt="淘宝网站商标" >

3.在淘宝网图片右边写一个大盒子用于存放搜索引擎与一些主要购物大板块的链接

 <div class="search_box"> </div>

4 .在search_box大盒子里面放入搜索框和搜索按钮以及装购物超标签的盒子

<span class="search_warp">  <input type="text" class="search_text" value="女装"></span>

<input type="submit" value="搜索" class="search_button">

 <div class="search_links"></div>

5.在search_links盒子写入常购物板块的超链接 

<a href="#" class="red">一淘限时</a>

<a href="#">苹果</a>

<a href="#">手链</a>

 <a href="#">窗帘</a>

 <a href="#">女裤</a>

 <a href="#">mac</a>

<a href="#">手表</a>

 <a href="#">女袜</a>

<a href="#">电动牙刷</a>

<a href="#">杯子</a>

<a href="#">包包</a> 

css主要书写内容:

<style>
        div{
            display: block;
        }
        .nav{
            width: 1438px;
            height: 125px;
            /* background-color: pink; */
            text-align: center;
        }
        .nav img{
            padding: 22px 0 23px;
            /* display: inline-block; */
            height: auto;
            max-width: 100%;
            vertical-align: top
        }
       .nav .search_box{
            position: relative;
            display:inline-block;
            width: 690px;
            height: px;
            /* background-color: g */
            border: 3px solid #f03726;
            border-right: 0;
            /* float: right; */
            height: 34px;
            line-height: 23px;
            margin-top: 30px;
            margin-left: 80px;  
       }
       .search_text{
            height: 23px;
            font-size: 12px;
            border: 0;
            width: 85%;
            outline: 0;
            /* padding-top: 5px; */
            margin-top: 5px; 
        }
       
        .search_button{
        width: 95px;
        height: 40px;
        border: 0;
        position: absolute;
        top: -3px;
        right: 0;
        background: #f03726;
        color: #f5f5f2;
        font-size: 18px;
        float: right;
       }
       .search_warp{
            display: inline;
            overflow: hidden;
            padding: 8px 110px 8px 10px
       }
       .search_links{
            text-decoration: none;
            padding-top: 10px;
            height: 23px;
            line-height: 23px;
            overflow: hidden;
            width: 690px;
            text-align: left;
           margin-left: 18px;
           color: #000;
            /* display: block; */

       }
       .search_links .red{
           color: red;
       }
       a{
           text-decoration: none;
       }
       .search_links a{
            float: left;
            margin-right: 20px;
       }
    </style>

淘宝首页导航标签的实现: 

<!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>淘宝主页</title>
    <style>
        div{
            display: block;
        }
        .nav{
            width: 1438px;
            height: 125px;
            /* background-color: pink; */
            text-align: center;
        }
        .nav img{
            padding: 22px 0 23px;
            /* display: inline-block; */
            height: auto;
            max-width: 100%;
            vertical-align: top
        }
       .nav .search_box{
            position: relative;
            display:inline-block;
            width: 690px;
            height: px;
            /* background-color: g */
            border: 3px solid #f03726;
            border-right: 0;
            /* float: right; */
            height: 34px;
            line-height: 23px;
            margin-top: 30px;
            margin-left: 80px;  
       }
       .search_text{
            height: 23px;
            font-size: 12px;
            border: 0;
            width: 85%;
            outline: 0;
            /* padding-top: 5px; */
            margin-top: 5px; 
        }
       
        .search_button{
        width: 95px;
        height: 40px;
        border: 0;
        position: absolute;
        top: -3px;
        right: 0;
        background: #f03726;
        color: #f5f5f2;
        font-size: 18px;
        float: right;
       }
       .search_warp{
            display: inline;
            overflow: hidden;
            padding: 8px 110px 8px 10px
       }
       .search_links{
            text-decoration: none;
            padding-top: 10px;
            height: 23px;
            line-height: 23px;
            overflow: hidden;
            width: 690px;
            text-align: left;
           margin-left: 18px;
           color: #000;
            /* display: block; */

       }
       .search_links .red{
           color: red;
       }
       a{
           text-decoration: none;
       }
       .search_links a{
            float: left;
            margin-right: 20px;
       }
    </style>
</head>
<body>
    <div class="nav">
        <img src="./images/tabao.jpg" alt="淘宝网站商标" >
        <div class="search_box">
          <span class="search_warp">  <input type="text" class="search_text" value="女装"></span>
            <input type="submit" value="搜索" class="search_button">
            <div class="search_links">
                <a href="#" class="red">一淘限时</a>
                <a href="#">苹果</a>
                <a href="#">手链</a>
                <a href="#">窗帘</a>
                <a href="#">女裤</a>
                <a href="#">mac</a>
                <a href="#">手表</a>
                <a href="#">女袜</a>
                <a href="#">电动牙刷</a>
                <a href="#">杯子</a>
                <a href="#">包包</a>
             </div>
        </div>
      
    </div>
</body>
</html>

运行结果:

代码中使用的图片,我将其放入到百度网盘中,大家可以自己去提取:

链接:https://pan.baidu.com/s/1nKw1vN6ovzm4K7VRk17hPg?pwd=1mvr 
提取码:1mvr

  • 8
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Luck&Strive

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值