博客列表 >端午作业之仿理工学院学生平台首页

端午作业之仿理工学院学生平台首页

简行
简行原创
2020年06月28日 15:29:28645浏览

仿理工学院学生平台首页

1.运用FlexBox布局技术,对以下首页图片进行仿站:


2.使用FlexBox布局,背景的处理,a标签,阿里图标的使用等,展示图如下:

3.页面HTML代码如下:

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>仿理工学院学生平台首页</title>
  7. <link rel="stylesheet" href="./css/index.css" />
  8. <!-- 引入图标样式 -->
  9. <link rel="stylesheet" href="./font/iconfont.css" />
  10. </head>
  11. <body>
  12. <!-- 页面 -->
  13. <header>
  14. <div class="top1">
  15. <a href=""
  16. ><img src="./imges/LOGO01.png" alt="" style="width: 200px;"
  17. /></a>
  18. <div>
  19. <a href=""><span class="iconfont icon-icon-test">首页</span></a>
  20. <a href=""><span class="iconfont icon-tubiaozhizuo-">财务</span></a>
  21. <a href=""><span class="iconfont icon-ren">个人</span></a>
  22. <a href=""><span class="iconfont icon-xiaoxi">消息</span></a>
  23. <a href=""><span class="iconfont icon-icon-test1">注销</span></a>
  24. </div>
  25. </div>
  26. <hr style="color: springgreen; width: 100%;" />
  27. <div class="top2">
  28. <a href="" class="iconfont icon-tubiaozhizuomoban-">课程</a>
  29. <a href="" class="iconfont icon-kaoshi">考试</a>
  30. <a href="" class="iconfont icon-chengji">成绩</a>
  31. <a href="" class="iconfont icon-education">毕业</a>
  32. <a href="" class="iconfont icon-education">学位</a>
  33. <a href="" class="iconfont icon-bijiben">统考</a>
  34. </div>
  35. </header>
  36. <!-- 主体 -->
  37. <div class="container">
  38. <!-- 左侧 -->
  39. <div class="left">
  40. <div class="study">
  41. <!-- <div
  42. style="
  43. background-image: url(./imges/default_major.png);
  44. width: 280px;
  45. height: 163px;
  46. "
  47. >
  48. <img src="./imges/.png" alt="">
  49. </div> -->
  50. <img
  51. src="./imges/back.png"
  52. alt=""
  53. style="width: 280px; height: 163px;"
  54. />
  55. <div class="course">
  56. <h3>C语言程序设计</h3>
  57. <p>辅导教师: 无 学期: 一 学分: 3.0 课程成绩: --</p>
  58. <p>
  59. 发帖: 0 / -- 条 课件学习: 11 / -- 次 总时长: 1272.6 / 1080 分钟
  60. </p>
  61. <div>
  62. <a href=""
  63. ><span class="iconfont icon-tubiaozhizuomoban- iconbule"></span
  64. >课程学习</a
  65. >
  66. <a href="">
  67. <span class="iconfont icon-luntan iconbule"></span>课程论坛</a
  68. >
  69. <a href=""
  70. ><span class="iconfont icon-zuoye iconbule"></span>作业列表<span
  71. >></span
  72. ></a
  73. >
  74. <a href=""
  75. ><span class="iconfont icon-bijiben iconbule"></span
  76. >导学资料<span>></span></a
  77. >
  78. <a href=""
  79. ><span class="iconfont icon-lianxi iconbule"></span
  80. >阶段练习<span>></span></a
  81. >
  82. </div>
  83. </div>
  84. </div>
  85. <div class="study">
  86. <img
  87. src="./imges/back.png"
  88. alt=""
  89. style="width: 280px; height: 163px;"
  90. />
  91. <div class="course">
  92. <h3>中国近现代史纲要</h3>
  93. <p>辅导教师: 无 学期: 一 学分: 3.0 课程成绩: --</p>
  94. <p>
  95. 发帖: 0 / -- 条 课件学习: 7 / -- 次 总时长: 1094.0 / 1080 分钟
  96. </p>
  97. <div>
  98. <a href=""
  99. ><span class="iconfont icon-tubiaozhizuomoban- iconbule"></span
  100. >课程学习</a
  101. >
  102. <a href="">
  103. <span class="iconfont icon-luntan iconbule"></span>课程论坛</a
  104. >
  105. <a href=""
  106. ><span class="iconfont icon-zuoye iconbule"></span>作业列表<span
  107. >></span
  108. ></a
  109. >
  110. <a href=""
  111. ><span class="iconfont icon-bijiben iconbule"></span
  112. >导学资料<span>></span></a
  113. >
  114. <a href=""
  115. ><span class="iconfont icon-lianxi iconbule"></span
  116. >阶段练习<span>></span></a
  117. >
  118. </div>
  119. </div>
  120. </div>
  121. <div class="study">
  122. <img
  123. src="./imges/back.png"
  124. alt=""
  125. style="width: 280px; height: 163px;"
  126. />
  127. <div class="course">
  128. <h3>大学英语1</h3>
  129. <p>辅导教师: 无 学期: 一 学分: 3.0 课程成绩: --</p>
  130. <p>
  131. 发帖: 0 / -- 条 课件学习: 13 / -- 次 总时长: 1164.9 / 1080 分钟
  132. </p>
  133. <div>
  134. <a href=""
  135. ><span class="iconfont icon-tubiaozhizuomoban- iconbule"></span
  136. >课程学习</a
  137. >
  138. <a href="">
  139. <span class="iconfont icon-luntan iconbule"></span>课程论坛</a
  140. >
  141. <a href=""
  142. ><span class="iconfont icon-zuoye iconbule"></span>作业列表<span
  143. >></span
  144. ></a
  145. >
  146. <a href=""
  147. ><span class="iconfont icon-bijiben iconbule"></span
  148. >导学资料<span>></span></a
  149. >
  150. <a href=""
  151. ><span class="iconfont icon-lianxi iconbule"></span
  152. >阶段练习<span>></span></a
  153. >
  154. </div>
  155. </div>
  156. </div>
  157. <div class="study">
  158. <img
  159. src="./imges/back.png"
  160. alt=""
  161. style="width: 280px; height: 163px;"
  162. />
  163. <div class="course">
  164. <h3>线性代数</h3>
  165. <p>辅导教师: 无 学期: 一 学分: 3.0 课程成绩: --</p>
  166. <p>
  167. 发帖: 0 / -- 条 课件学习: 26 / -- 次 总时长: 1574.8 / 1080 分钟
  168. </p>
  169. <div>
  170. <a href=""
  171. ><span class="iconfont icon-tubiaozhizuomoban- iconbule"></span
  172. >课程学习</a
  173. >
  174. <a href="">
  175. <span class="iconfont icon-luntan iconbule"></span>课程论坛</a
  176. >
  177. <a href=""
  178. ><span class="iconfont icon-zuoye iconbule"></span>作业列表<span
  179. >></span
  180. ></a
  181. >
  182. <a href=""
  183. ><span class="iconfont icon-bijiben iconbule"></span
  184. >导学资料<span>></span></a
  185. >
  186. <a href=""
  187. ><span class="iconfont icon-lianxi iconbule"></span
  188. >阶段练习<span>></span></a
  189. >
  190. </div>
  191. </div>
  192. </div>
  193. </div>
  194. <!-- 右侧 -->
  195. <div class="right">
  196. <!-- 用户信息 -->
  197. <div>
  198. <div class="admin">
  199. <img src="./imges/touxiang.png" alt="" class="imgset" />
  200. <div>
  201. <p>Hi,admin</p>
  202. <p>上次登录:--</p>
  203. </div>
  204. </div>
  205. <a href="">面授课程表下载</a>
  206. </div>
  207. <!-- 通知公告 -->
  208. <div>
  209. <div class="tip">
  210. <span>通知公告</span>
  211. <span><a href="">公告</a><a href="">代办</a></span>
  212. </div>
  213. <div><img src="./imges/none.png" alt="" /></div>
  214. </div>
  215. <!-- 调查问卷 -->
  216. <hr style="color: rgb(250, 241, 241);" />
  217. <div>
  218. <div class="tip"><span>通知公告 </span><a href="">更多></a></div>
  219. <div><img src="./imges/none.png" alt="" /></div>
  220. </div>
  221. </div>
  222. </div>
  223. <!-- 页脚 -->
  224. <footer>
  225. <span class="iconfont icon-icon-test">厦门理工学院继续教育学院</span>
  226. <p>主办单位:厦门理工学院; 技术支持:弘成科技发展有限公司;</p>
  227. <p>Copyright©2020弘成科技发展有限公司版权所有;</p>
  228. </footer>
  229. </body>
  230. </html>

4.CSS代码如下:

  1. /* 初始化 */
  2. * {
  3. margin: 0;
  4. padding: 0;
  5. box-sizing: border-box;
  6. }
  7. body {
  8. background: #f2f2f2;
  9. display: flex;
  10. flex-flow: column nowrap;
  11. align-items: center;
  12. }
  13. a {
  14. text-decoration: none;
  15. color: darkgray;
  16. }
  17. header,
  18. footer {
  19. /* min-width: 1200px; */
  20. width: 100%;
  21. height: 100px;
  22. }
  23. header {
  24. background: #fff;
  25. display: flex;
  26. flex-flow: column nowrap;
  27. align-items: center;
  28. }
  29. .imgset {
  30. /* 圆角百分比 */
  31. border-radius: 50%;
  32. }
  33. .iconbule {
  34. color: rgb(111, 175, 204);
  35. }
  36. .top1 {
  37. width: 1200px;
  38. display: flex;
  39. min-height: 50px;
  40. /* flex: 0 0 400px; */
  41. justify-content: space-between;
  42. align-items: center;
  43. margin: auto 60px;
  44. }
  45. .top1 > div {
  46. display: flex;
  47. }
  48. .top1 > div > a {
  49. text-align: center;
  50. margin-right: 30px;
  51. }
  52. .top1 > div > a:first-of-type {
  53. color: turquoise;
  54. }
  55. .top1 > div > a:hover {
  56. color: turquoise;
  57. }
  58. .top2 {
  59. width: 1200px;
  60. min-height: 50px;
  61. margin-left: 60px;
  62. display: flex;
  63. justify-content: flex-start;
  64. align-items: center;
  65. }
  66. .top2 > a {
  67. margin-right: 80px;
  68. font-size: 1.5rem;
  69. }
  70. .top2 > a:hover {
  71. padding-bottom: 3px;
  72. border-bottom: 4px solid orange;
  73. }
  74. /* 左侧 */
  75. .container {
  76. margin-top: 20px;
  77. min-width: 1200px;
  78. display: flex;
  79. justify-content: space-between;
  80. }
  81. .left {
  82. display: flex;
  83. flex-flow: column nowrap;
  84. }
  85. .study {
  86. margin-bottom: 15px;
  87. min-height: 165px;
  88. display: flex;
  89. align-items: center;
  90. }
  91. .course {
  92. width: 570px;
  93. background-color: white;
  94. margin-left: 15px;
  95. min-height: 165px;
  96. padding-left: 10px;
  97. display: flex;
  98. flex-flow: column nowrap;
  99. justify-content: space-evenly;
  100. }
  101. /* 右侧 */
  102. .right {
  103. width: inherit;
  104. background-color: #fff;
  105. display: flex;
  106. flex-flow: column nowrap;
  107. }
  108. .right > div {
  109. margin-bottom: 15px;
  110. }
  111. .right > div:first-of-type {
  112. padding: 10px 0;
  113. display: flex;
  114. flex-flow: column nowrap;
  115. align-items: flex-start;
  116. }
  117. .admin {
  118. margin-left: 15px;
  119. display: flex;
  120. }
  121. .admin > div {
  122. margin-left: 20px;
  123. display: flex;
  124. flex-flow: column nowrap;
  125. justify-content: space-evenly;
  126. }
  127. .right > div:first-of-type > a {
  128. background-color: rgb(107, 105, 105);
  129. border-radius: 5px;
  130. font-size: 1.5rem;
  131. text-align: center;
  132. margin: 10px auto;
  133. padding: 0 35px;
  134. }
  135. .tip {
  136. display: flex;
  137. justify-content: space-between;
  138. border-bottom: 1px solid #ebebeb;
  139. }
  140. .tip > :last-of-type {
  141. display: flex;
  142. }
  143. .tip > :last-of-type > a {
  144. background-color: rgb(250, 241, 241);
  145. border: 1px solid #ebebeb;
  146. }
  147. .tip > :last-of-type > a:first-of-type {
  148. border: 1px solid #ebebeb;
  149. border-bottom: 1px solid #fff;
  150. border-top: 1px solid #179ee1;
  151. color: #179ee1;
  152. background: #fff;
  153. }
  154. /* 页脚 */
  155. footer {
  156. background: #f0eeee;
  157. display: flex;
  158. flex-flow: column nowrap;
  159. justify-content: center;
  160. align-items: center;
  161. }

总结

1.阿里图标跟使用前不一致,有些图片无法设置为彩色图案,有待进一步解决
2.背景图的属性使用生疏,需再熟练
3.各个模块的宽高设置错误,影响整体布局,需要多联系
4.首页使用FlexBox且多次使用进行一个页面的布局,对弹性盒子的各个属性有一定的了解

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