博客列表 >1107作业

1107作业

遗忘了寂寞
遗忘了寂寞原创
2019年11月08日 19:29:05740浏览

手机页面部分代码

  1. <!--最新更新-->
  2. <article class="news">
  3. <h3>最新更新</h3>
  4. <section class="img-txet">
  5. <div>
  6. <a href=""><img src="static/images/tjkc4.jpg" alt=""></a>
  7. <span>
  8. <a href="">2019python自学视频</a>
  9. <span>本课程适合想从零开始学习 Python 编程语言的开发人员。由浅入深的带</span>
  10. <span><i>初级</i>3614次播放</span>
  11. </span>
  12. </div>
  13. </section>
  14. <section class="img-txet">
  15. <div>
  16. <a href=""><img src="static/images/tjkc3.jpg" alt=""></a>
  17. <span>
  18. <a href="">PHP开发免费公益直播课</a>
  19. <span>主讲:php中文网-朱老师( Peter Zhu) 时间:2019.10.17 晚 20:00-22:00</span>
  20. <span><i>初级</i>3614次播放</span>
  21. </span>
  22. </div>
  23. </section>
  24. <section class="img-txet">
  25. <div>
  26. <a href=""><img src="static/images/tjkc4.jpg" alt=""></a>
  27. <span>
  28. <a href="">从零开始到WEB响应式布局</a>
  29. <span>重点介绍了HTML、CSS、web布局前端核心技术,通过视频讲解,</span>
  30. <span><i>初级</i>3614次播放</span>
  31. </span>
  32. </div>
  33. </section>
  34. <section class="img-txet">
  35. <div>
  36. <a href=""><img src="static/images/tjkc3.jpg" alt=""></a>
  37. <span>
  38. <a href="">PHP文件基础操作</a>
  39. <span>好多同学在PHP基础的时候对PHP文件的操作了解的不够多,</span>
  40. <span><i>初级</i>3614次播放</span>
  41. </span>
  42. </div>
  43. </section>
  44. </article>
  45. <!--最新文章-->
  46. <article class="news">
  47. <h3>最新文章</h3>
  48. <section class="img-txet">
  49. <div>
  50. <span>
  51. <a href="">2019python自学视频</a>
  52. <span>发布时间:</span>
  53. </span>
  54. <a href=""><img src="static/images/tjkc4.jpg" alt=""></a>
  55. </div>
  56. </section>
  57. <section class="img-txet">
  58. <div>
  59. <span>
  60. <a href="">php 安装zip模块</a>
  61. <span>发布时间:</span>
  62. </span>
  63. <a href=""><img src="static/images/tjkc3.jpg" alt=""></a>
  64. </div>
  65. </section>
  66. <section class="img-txet">
  67. <div>
  68. <span>
  69. <a href="">2019python自学视频</a>
  70. <span>发布时间:</span>
  71. </span>
  72. <a href=""><img src="static/images/tjkc4.jpg" alt=""></a>
  73. </div>
  74. </section>
  75. <section class="img-txet">
  76. <div>
  77. <span>
  78. <a href="">php 安装zip模块</a>
  79. <span>发布时间:</span>
  80. </span>
  81. <a href=""><img src="static/images/tjkc3.jpg" alt=""></a>
  82. </div>
  83. </section>
  84. <div class="more">
  85. <a href="">更多内容</a>
  86. </div>
  87. </article>
  88. <!--最新博文-->
  89. <article class="news">
  90. <h3>最新博文</h3>
  91. <section class="img-txet">
  92. <div>
  93. <span>
  94. <a href="">Linux系统CentOS报错:could not resolve host:mirrorlist.centos.org问题</a>
  95. <span>发布时间:</span>
  96. </span>
  97. </div>
  98. </section>
  99. <section class="img-txet">
  100. <div>
  101. <span>
  102. <a href="">Linux系统CentOS报错:could not resolve host:mirrorlist.centos.org问题</a>
  103. <span>发布时间:</span>
  104. </span>
  105. </div>
  106. </section>
  107. <section class="img-txet">
  108. <div>
  109. <span>
  110. <a href="">Linux系统CentOS报错:could not resolve host:mirrorlist.centos.org问题</a>
  111. <span>发布时间:</span>
  112. </span>
  113. </div>
  114. </section>
  115. <section class="img-txet">
  116. <div>
  117. <span>
  118. <a href="">Linux系统CentOS报错:could not resolve host:mirrorlist.centos.org问题</a>
  119. <span>发布时间:</span>
  120. </span>
  121. </div>
  122. </section>
  123. <div class="more">
  124. <a href="">更多内容</a>
  125. </div>
  126. </article>
  127. <!--这个模块与上面的最新课程几乎是一样的, 只是左右顺序交换了一个,样式略有不同-->
  128. <!-- 最新博文,最新问答,做为作业,交给大家课后完成 -->
  129. </main>
  130. <!--下面咱们做一下底部,底部与头部类似,也是固定定位实现-->
  131. <footer>
  132. <a href=""><img src="static/font-icon/zhuye.png" alt=""><span>主页</span></a>
  133. <a href="">
  134. <img src="static/font-icon/video.png" alt="">
  135. <span>视频</span>
  136. </a>
  137. <a href="">
  138. <img src="static/font-icon/luntan.png" alt="">
  139. <span>社区</span>
  140. </a>
  141. <a href="">
  142. <img src="static/font-icon/geren.png" alt="">
  143. <span>我的</span>
  144. </a>
  145. </footer>
  1. /*将所有article转为盒子*/
  2. main > article {
  3. display: flex;
  4. flex-flow: column nowrap;
  5. }
  6. /*将所有section 转为盒子*/
  7. main > article > section > div {
  8. background-color: #fff;
  9. margin: 5px;
  10. /*也转为弹性容器*/
  11. display: flex;
  12. flex-flow: row nowrap;
  13. justify-content: space-between;
  14. align-items: center;
  15. }
  16. main > article > section > div img {
  17. width: 350px;
  18. height: 90px;
  19. }
  20. main > article > section > div > span {
  21. width: 100%;
  22. padding: 5px 15px;
  23. display: flex;
  24. /*文本垂直排列*/
  25. flex-flow: column nowrap;
  26. margin-top: 5px;
  27. /* padding-left: 10px; */
  28. }
  29. main > article > section > div > span >span {
  30. font-size: 12px;
  31. margin: 5px 0px;
  32. }
  33. main > article> section > div > span i {
  34. font-style: normal;
  35. background-color: #333333;
  36. color: white;
  37. border-radius: 4px;
  38. padding: 0 5px;
  39. font-size: smaller;
  40. }
  41. /* 更多 */
  42. .more{
  43. margin: 5px;
  44. height: 30px;
  45. line-height: 30px;
  46. text-align:center;
  47. background-color: #fff;
  48. }
  49. /*底部*/
  50. footer {
  51. /*固定定位*/
  52. position: fixed;bottom: 0;
  53. /*固定定位元素必须设置宽度与高度*/
  54. width: 100%;
  55. height: 50px;
  56. background: #edeff0;
  57. color: white;
  58. /*底部上边框*/
  59. border-top: 2px solid #ccc;
  60. /*转为Flex容器,设置元素排列*/
  61. display: flex;
  62. /*元素主轴对齐方式为间距相同*/
  63. justify-content: space-evenly;
  64. }
  65. footer > a{
  66. margin: 5px;font-size: 15px;
  67. display: flex;
  68. flex-flow: column nowrap;
  69. justify-content:center;
  70. align-items: center;
  71. }
  72. footer > a >img {
  73. height: 20px;width: 20px;
  74. }
  75. footer > a >span {
  76. margin-top: 3px;
  77. }



总结

把这两周所学的CSS进行了汇总






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