亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

搜索
博主信息
博文 7
粉絲 0
評論 1
訪問量 3308
最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板
flex語法簡單的導(dǎo)航欄
學(xué),無止盡
原創(chuàng)
459人瀏覽過

這是用flex編寫的簡單導(dǎo)航欄

直接上代碼吧

  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  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>grid演示</title>
  8. </head>
  9. <body>
  10. <div class="content">
  11. <header>
  12. <nav>
  13. <a href="">首頁</a>
  14. <a href="">視頻</a>
  15. <a href="">社區(qū)</a>
  16. <a href="">文章</a>
  17. <a href="">咨詢</a>
  18. <a href="">簡介</a>
  19. <a href="">源碼</a>
  20. <a href="">作業(yè)</a>
  21. <a href="">下載</a>
  22. </nav>
  23. <button>登陸</button>
  24. </header>
  25. </div>
  26. <footer class="footer">頁腳</footer>
  27. <style>
  28. .box {
  29. width: 100%;
  30. height: 2000px;
  31. }
  32. header {
  33. height: 80px;
  34. background-color: rgb(248, 244, 244);
  35. padding: 0 5em;
  36. display: flex;
  37. place-content: space-between;
  38. position: sticky;
  39. top: 0;
  40. color: #0c0202;
  41. }
  42. nav {
  43. display: flex;
  44. /* 水平垂直居中 */
  45. text-align: center;
  46. line-height: 80px;
  47. }
  48. nav a {
  49. min-width: 5em;
  50. color: #0c0505;
  51. text-decoration: none;
  52. flex: 1;
  53. }
  54. nav a:hover {
  55. color: white;
  56. background-color: aqua;
  57. transition: 0.3s;
  58. }
  59. header button {
  60. border: none;
  61. width: 5em;
  62. background-color: rgb(3, 5, 4);
  63. color: azure;
  64. }
  65. header button:hover {
  66. cursor: pointer;
  67. background-color: rgb(22, 228, 228);
  68. }
  69. footer {
  70. width: 100%;
  71. height: 50px;
  72. color: #ccc;
  73. background-color: black;
  74. text-align: center;
  75. line-height: 50px;
  76. }
  77. .box .title {
  78. height: 50px;
  79. font-weight: bolder;
  80. border: 1px solid #f5f1f1;
  81. background-color: rgb(10, 10, 10);
  82. }
  83. .box .content {
  84. min-width: 100%;
  85. min-height: 0px;
  86. background-color: #eee;
  87. }
  88. .box .title {
  89. /* 滾動到top=0就會自動停止并固定在當(dāng)前位置 */
  90. position: sticky;
  91. top: 0;
  92. color: #9b9292;
  93. line-height: 50px;
  94. padding: 0 20em;
  95. }
  96. .box1 {
  97. width: 100px;
  98. height: 500px;
  99. display: flex;
  100. border: 1px solid #e0e4de6b;
  101. place-content: space-evenly;
  102. flex-flow: column nowrap;
  103. position: fixed;
  104. top: 5cm;
  105. bottom: 0;
  106. /* line-height: 50px; */
  107. border-radius: 20px 20px 20px 20px;
  108. }
  109. .box1 a {
  110. width: 100%;
  111. height: 25px;
  112. letter-spacing: 2px;
  113. text-align: center;
  114. text-decoration: none;
  115. color: #9b9292;
  116. /* flex: 1 1 auto; */
  117. }
  118. .box1 a:hover {
  119. color: white;
  120. background-color: rgb(70, 184, 159);
  121. transition: 0.1s;
  122. }
  123. </style>
  124. </body>
  125. </html>
  • 下面是效果圖,如有錯誤請各位老師和大佬多多指教!

批改老師:PHPzPHPz

批改狀態(tài):合格

老師批語:完成的很好,沒什么問題,繼續(xù)加油
本博文版權(quán)歸博主所有,轉(zhuǎn)載請注明地址!如有侵權(quán)、違法,請聯(lián)系admin@php.cn舉報處理!
全部評論 文明上網(wǎng)理性發(fā)言,請遵守新聞評論服務(wù)協(xié)議
0條評論
作者最新博文
關(guān)于我們 免責(zé)申明 意見反饋 講師合作 廣告合作 最新更新
php中文網(wǎng):公益在線php培訓(xùn),幫助PHP學(xué)習(xí)者快速成長!
關(guān)注服務(wù)號 技術(shù)交流群
PHP中文網(wǎng)訂閱號
每天精選資源文章推送
PHP中文網(wǎng)APP
隨時隨地碎片化學(xué)習(xí)
PHP中文網(wǎng)抖音號
發(fā)現(xiàn)有趣的

Copyright 2014-2025 http://ipnx.cn/ All Rights Reserved | php.cn | 湘ICP備2023035733號

  • 登錄PHP中文網(wǎng),和優(yōu)秀的人一起學(xué)習(xí)!
    全站2000+教程免費(fèi)學(xué)