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


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

     html主要书写内容:

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

    2.插入一张淘宝网图片 

    淘宝网站商标

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

     

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

     

     

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

    一淘限时

    苹果

    手链

     窗帘

     女裤

     mac

    手表

     女袜

    电动牙刷

    杯子

    包包 

    css主要书写内容:

    1. <style>
    2. div{
    3. display: block;
    4. }
    5. .nav{
    6. width: 1438px;
    7. height: 125px;
    8. /* background-color: pink; */
    9. text-align: center;
    10. }
    11. .nav img{
    12. padding: 22px 0 23px;
    13. /* display: inline-block; */
    14. height: auto;
    15. max-width: 100%;
    16. vertical-align: top
    17. }
    18. .nav .search_box{
    19. position: relative;
    20. display:inline-block;
    21. width: 690px;
    22. height: px;
    23. /* background-color: g */
    24. border: 3px solid #f03726;
    25. border-right: 0;
    26. /* float: right; */
    27. height: 34px;
    28. line-height: 23px;
    29. margin-top: 30px;
    30. margin-left: 80px;
    31. }
    32. .search_text{
    33. height: 23px;
    34. font-size: 12px;
    35. border: 0;
    36. width: 85%;
    37. outline: 0;
    38. /* padding-top: 5px; */
    39. margin-top: 5px;
    40. }
    41. .search_button{
    42. width: 95px;
    43. height: 40px;
    44. border: 0;
    45. position: absolute;
    46. top: -3px;
    47. right: 0;
    48. background: #f03726;
    49. color: #f5f5f2;
    50. font-size: 18px;
    51. float: right;
    52. }
    53. .search_warp{
    54. display: inline;
    55. overflow: hidden;
    56. padding: 8px 110px 8px 10px
    57. }
    58. .search_links{
    59. text-decoration: none;
    60. padding-top: 10px;
    61. height: 23px;
    62. line-height: 23px;
    63. overflow: hidden;
    64. width: 690px;
    65. text-align: left;
    66. margin-left: 18px;
    67. color: #000;
    68. /* display: block; */
    69. }
    70. .search_links .red{
    71. color: red;
    72. }
    73. a{
    74. text-decoration: none;
    75. }
    76. .search_links a{
    77. float: left;
    78. margin-right: 20px;
    79. }
    80. style>

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

    1. html>
    2. <html lang="en">
    3. <head>
    4. <meta charset="UTF-8">
    5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
    6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
    7. <title>淘宝主页title>
    8. <style>
    9. div{
    10. display: block;
    11. }
    12. .nav{
    13. width: 1438px;
    14. height: 125px;
    15. /* background-color: pink; */
    16. text-align: center;
    17. }
    18. .nav img{
    19. padding: 22px 0 23px;
    20. /* display: inline-block; */
    21. height: auto;
    22. max-width: 100%;
    23. vertical-align: top
    24. }
    25. .nav .search_box{
    26. position: relative;
    27. display:inline-block;
    28. width: 690px;
    29. height: px;
    30. /* background-color: g */
    31. border: 3px solid #f03726;
    32. border-right: 0;
    33. /* float: right; */
    34. height: 34px;
    35. line-height: 23px;
    36. margin-top: 30px;
    37. margin-left: 80px;
    38. }
    39. .search_text{
    40. height: 23px;
    41. font-size: 12px;
    42. border: 0;
    43. width: 85%;
    44. outline: 0;
    45. /* padding-top: 5px; */
    46. margin-top: 5px;
    47. }
    48. .search_button{
    49. width: 95px;
    50. height: 40px;
    51. border: 0;
    52. position: absolute;
    53. top: -3px;
    54. right: 0;
    55. background: #f03726;
    56. color: #f5f5f2;
    57. font-size: 18px;
    58. float: right;
    59. }
    60. .search_warp{
    61. display: inline;
    62. overflow: hidden;
    63. padding: 8px 110px 8px 10px
    64. }
    65. .search_links{
    66. text-decoration: none;
    67. padding-top: 10px;
    68. height: 23px;
    69. line-height: 23px;
    70. overflow: hidden;
    71. width: 690px;
    72. text-align: left;
    73. margin-left: 18px;
    74. color: #000;
    75. /* display: block; */
    76. }
    77. .search_links .red{
    78. color: red;
    79. }
    80. a{
    81. text-decoration: none;
    82. }
    83. .search_links a{
    84. float: left;
    85. margin-right: 20px;
    86. }
    87. style>
    88. head>
    89. <body>
    90. <div class="nav">
    91. <img src="./images/tabao.jpg" alt="淘宝网站商标" >
    92. <div class="search_box">
    93. <span class="search_warp"> <input type="text" class="search_text" value="女装">span>
    94. <input type="submit" value="搜索" class="search_button">
    95. <div class="search_links">
    96. <a href="#" class="red">一淘限时a>
    97. <a href="#">苹果a>
    98. <a href="#">手链a>
    99. <a href="#">窗帘a>
    100. <a href="#">女裤a>
    101. <a href="#">maca>
    102. <a href="#">手表a>
    103. <a href="#">女袜a>
    104. <a href="#">电动牙刷a>
    105. <a href="#">杯子a>
    106. <a href="#">包包a>
    107. div>
    108. div>
    109. div>
    110. body>
    111. html>

    运行结果:

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

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

  • 相关阅读:
    (附源码)ssm招聘网站 毕业设计 250858
    s27.linux运维面试题分享
    SQLite3 操作命令以及c/c++编程API和例子
    从零打造“乞丐版” React(一)——从命令式编程到声明式编程
    vulnhub靶机Funbox11
    前端架构师之02_Node.js安装
    TCPIP协议栈的心跳、丢包重传、连接超时机制实例详解
    java计算机毕业设计家政服务系统MyBatis+系统+LW文档+源码+调试部署
    Python迭代器和生成器
    做库存功能业务场景详解,S2B2B系统助力建筑建材企业精准掌握库存动态
  • 原文地址:https://blog.csdn.net/gjbss/article/details/128014958