Blogger Information
Blog 25
fans 1
comment 1
visits 17288
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
1225作业+flex之组件的开发思路及导航实例+10期线上班
江川林
Original
532 people have browsed it

flex之组件的开发思路及导航实例

通过本次学习加深了对flex容器属性的学习与运用
实践是检验真理的唯一标准,实战也不例外

本次页面组件开发思路及实现过程
1、先自己理出页面的大体框架,由几个大板块组成
2、将各个大板块里面的内容填充好
3、根据页面的排版,写CSS,将页面进行排列

以下是导航代码

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>公共 网站导航</title>
  6. <link rel="stylesheet" href="public_inital_lead.css">
  7. <link rel="stylesheet" href="static/font/iconfont.css">
  8. </head>
  9. <body>
  10. <!--首页导航-->
  11. <div class="public-header">
  12. <div class="public-header-nav">
  13. <a href="">网站首页</a>
  14. <a href="">专题</a>
  15. <a href="">网站导航</a>
  16. <a href="">二手商品</a>
  17. <a href="">讨论区</a>
  18. </div>
  19. <div class="public-header-number">
  20. <a href=""><i class="iconfont icon-huiyuan2"></i>登录</a>
  21. <a href="">免费注册</a>
  22. </div>
  23. </div>
  24. <!--首页标题-->
  25. <div class="public-lead">
  26. <span>二手交易</span>
  27. </div>
  28. </body>
  29. </html>

以下是CSS代码

  1. /*初始化*/
  2. * {
  3. padding: 0;
  4. margin: 0;
  5. font-size: 13px;
  6. /*outline: 1px dashed red;*/
  7. }
  8. a {
  9. text-decoration: none;
  10. font-size: 13px;
  11. }
  12. li {
  13. list-style: none;
  14. }
  15. .public-header {
  16. height: 40px;
  17. background-color: black;
  18. display: flex;
  19. justify-content: space-between;
  20. }
  21. a {
  22. color: white;
  23. }
  24. .public-header > .public-header-nav {
  25. margin-left: 20px;
  26. display: flex;
  27. }
  28. .public-header > .public-header-nav a {
  29. padding:10px ;
  30. }
  31. .public-header > .public-header-nav a:hover {
  32. color: black;
  33. background-color: white;
  34. }
  35. .public-header > .public-header-number {
  36. display: flex;
  37. margin-right: 20px;
  38. }
  39. .public-header > .public-header-number a {
  40. padding: 10px;
  41. }
  42. .public-header > .public-header-number a:hover {
  43. color: black;
  44. background-color: white;
  45. }
  46. .public-header > .public-header-number i {
  47. padding-right: 5px;
  48. }
  49. .public-lead {
  50. display: flex;
  51. justify-content: center;
  52. }
  53. .public-lead span {
  54. font-size: 30px;
  55. font-weight: bolder;
  56. border-bottom: 3px solid red;
  57. padding-top: 30px;
  58. }

以下是手写flex项目6大属性
1
2

Correcting teacher:天蓬老师天蓬老师

Correction status:qualified

Teacher's comments:写页面之前, 整理一下思路, 画个草图是个好习惯
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!