博客列表 >元气满满的一天

元气满满的一天

牡丹飞
牡丹飞原创
2020年10月28日 10:21:11585浏览

1 效果

2 代码

  1. .box {
  2. border: aqua 2px solid;
  3. }
  4. body > .box-body {
  5. display: flex;
  6. flex: 1 1 auto;
  7. flex-flow: column nowrap;
  8. }
  9. header > .box-top {
  10. display: flex;
  11. flex-flow: row nowrap;
  12. align-items: center;
  13. }
  14. header > .box-top img {
  15. margin-left: 1em;
  16. }
  17. header > .box-top div {
  18. flex: 2em;
  19. }
  20. header > .box-top div:first-of-type {
  21. margin-left: 1em;
  22. }
  23. header > .box-top div:last-of-type {
  24. display: flex;
  25. justify-content: flex-end;
  26. margin-right: 1em;
  27. }
  28. header > .box-top div:last-of-type p {
  29. min-width: 3em;
  30. }
  31. header > .box-middle {
  32. display: flex;
  33. justify-content: center;
  34. align-items: center;
  35. padding: 1em 0;
  36. }
  37. header > .box-middle img {
  38. width: 4em;
  39. }
  40. header > .box-bottom {
  41. text-align: center;
  42. }
  43. .container > main > .box-top {
  44. display: flex;
  45. justify-content: center;
  46. align-items: center;
  47. }
  48. .container > main > .box-top > a {
  49. text-decoration: none;
  50. margin: auto;
  51. }
  52. .container > main > .box-middle {
  53. display: flex;
  54. justify-content: center;
  55. align-items: center;
  56. flex-flow: row wrap;
  57. }
  58. .container > main > .box-middle > a {
  59. text-decoration: none;
  60. flex: 0 0 6em;
  61. }
  62. .container > main > .box-bottom {
  63. display: flex;
  64. flex-flow: row nowrap;
  65. justify-content: center;
  66. }
  67. .container > main > .box-bottom > .box {
  68. min-height: 20em;
  69. }
  70. .container > main > .box-bottom > .box-left {
  71. width: 30%;
  72. }
  73. .container > main > .box-bottom > .box-main {
  74. width: 70%;
  75. }
  76. footer {
  77. text-align: center;
  78. }
  79. @media screen and (max-width: 1000px) {
  80. .container > main > .box-bottom > .box-left {
  81. display: none;
  82. }
  83. }
  84. @media screen and (max-width: 800px) {
  85. .container > main > .box-middle {
  86. display: none;
  87. }
  88. }
  89. .box-main {
  90. display: flex;
  91. flex-flow: row wrap;
  92. flex: 1 1 auto;
  93. align-items: center;
  94. justify-content: space-evenly;
  95. }
  96. .box-main > .box-img {
  97. border: orchid 2px dashed;
  98. background-color: skyblue;
  99. color: white;
  100. border-radius: 2em;
  101. min-height: 12em;
  102. min-width: 10em;
  103. display: flex;
  104. flex-flow: column nowrap;
  105. align-items: center;
  106. justify-content: space-evenly;
  107. }
  108. .box-main > .box-img > img {
  109. width: 3em;
  110. height: 3em;
  111. border-radius: 30%;
  112. }

3 总结

感谢老师的辛苦教导!
flex弹性盒子,布局不在神秘,但还是很神奇。
怎样才能学会设计美的页面,是去欣赏和上手吗?

声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议