Blogger Information
Blog 40
fans 0
comment 1
visits 39785
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
使用Flex布局仿php中文网
Dong.
Original
654 people have browsed it

模仿效果如下:

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>flex布局仿php中文网</title>
  7. <link rel="stylesheet" href="./dome.css">
  8. <link rel="stylesheet" href="./styer.css">
  9. </head>
  10. <body>
  11. <!-- 头部 -->
  12. <div class="header">
  13. <div class="nav">
  14. <div class="title">
  15. <ul>
  16. <li><a href="#">首页</a></li>
  17. <li><a href="#">视频教学</a></li>
  18. <li><a href="#">入门教学</a></li>
  19. <li><a href="#">社区问答</a></li>
  20. <li><a href="#">技术文章</a></li>
  21. <li><a href="#">资源下载</a></li>
  22. <li><a href="#">编程词典</a></li>
  23. <li><a href="#">工具下载</a></li>
  24. <li><a href="#">PHP培训</a></li>
  25. </ul>
  26. <p><a href="#">注册</a><a href="#">登录</a></p>
  27. </div>
  28. </div>
  29. </div>
  30. <!-- 主体 -->
  31. <div>
  32. <div>
  33. <ul>
  34. <li>
  35. <a href="">php开发</a>
  36. </li>
  37. <li>
  38. <a href="">前段开发</a>
  39. </li>
  40. <li>
  41. <a href="">服务端开发</a>
  42. </li>
  43. <li>
  44. <a href="">移动开发</a>
  45. </li>
  46. <li>
  47. <a href="">数据库</a>
  48. </li>
  49. <li>
  50. <a href="">服务器运维</a>
  51. </li>
  52. <li>
  53. <a href="">在线工具箱</a>
  54. </li>
  55. <li>
  56. <a href="">常用库类</a>
  57. </li>
  58. </ul>
  59. </div>
  60. <div class="viewAd">
  61. <div class="search">
  62. <a href="">php</a>
  63. <a href="">孤独</a>
  64. <a href="">php</a>
  65. <a href="">php开发</a>
  66. <a href="">php开发</a>
  67. <a href="">php开发</a>
  68. <a href="">课程直播</a>
  69. <span class="searchInput">
  70. <input type="text" placeholder="输入关键字搜索"><a href="">搜索</a>
  71. </span>
  72. </div>
  73. <div class="viewImg"><img src="./static/img/b1.p" alt=""></div>
  74. <div class="adImg">
  75. <p><a href=""><img src=".static/img/1.png" alt=""></a></p>
  76. <p><a href=""><img src=".static/img/1.png" alt=""></a></p>
  77. <p><a href=""><img src=".static/img/1.png" alt=""></a></p>
  78. <p><a href=""><img src=".static/img/1.png" alt=""></a></p>
  79. </div>
  80. </div>
  81. </div>
  82. <!-- AD -->
  83. <div class="ad1">
  84. <a href=""><img src=".static/img/1.png" alt=""></a>
  85. </div>
  86. <!-- 内容 -->
  87. <div class="content1">
  88. <!-- 左边 -->
  89. <div class="left">
  90. <h4>头条</h4>
  91. <p><a href="#">php中文网</a></p>
  92. <p><a href="#">php中文网</a></p>
  93. <p><a href="#">php中文网</a></p>
  94. <p><a href="#">php中文网</a></p>
  95. <p><a href="#">php中文网</a></p>
  96. <p><a href="#">php中文网</a></p>
  97. <p><a href="#">php中文网</a></p>
  98. <p><a href="#">php中文网</a></p>
  99. <p><a href="#">php中文网</a></p>
  100. <p><a href="#">php中文网</a></p>
  101. <p><a href="#">php中文网</a></p>
  102. <p><a href="#">php中文网</a></p>
  103. <p><a href="#">php中文网</a></p>
  104. </div>
  105. <!-- 内容中间 -->
  106. <div class="mian flexGrowAuto">
  107. <h4>最新课程</h4>
  108. <ul>
  109. <li>
  110. <a href="">
  111. <div><img src="./static/img/2.png" alt=""></div>
  112. <div><span>初级</span>前段教程</div>
  113. </a>
  114. </li>
  115. <li>
  116. <a href="">
  117. <div><img src="./static/img/2.png" alt=""></div>
  118. <div><span>初级</span>前段教程</div>
  119. </a>
  120. </li>
  121. <li>
  122. <a href="">
  123. <div><img src="./static/img/2.png" alt=""></div>
  124. <div><span>初级</span>前段教程</div>
  125. </a>
  126. </li>
  127. <li>
  128. <a href="">
  129. <div><img src="./static/img/2.png" alt=""></div>
  130. <div><span>初级</span>前段教程</div>
  131. </a>
  132. </li>
  133. <li>
  134. <a href="">
  135. <div><img src="./static/img/2.png" alt=""></div>
  136. <div><span>初级</span>前段教程</div>
  137. </a>
  138. </li>
  139. <li>
  140. <a href="">
  141. <div><img src="./static/img/2.png" alt=""></div>
  142. <div><span>初级</span>前段教程</div>
  143. </a>
  144. </li>
  145. </ul>
  146. </div>
  147. <!-- 右 -->
  148. <div class="right">
  149. <h4>常用手册</h4><h4>更多...</h4>
  150. <ul>
  151. <li class="flexDis">
  152. <div class="rightImg"><img src="./static/img/2.png" alt=""></div>
  153. <div class="rightFont">
  154. <a href="">php手册</a>
  155. <a href="">linux手册</a>
  156. <a href="">ci手册</a>
  157. <a href="">php手册</a>
  158. </div>
  159. </li>
  160. <li class="flexDis">
  161. <div class="rightImg"><img src="./static/img/2.png" alt=""></div>
  162. <div class="rightFont flexDis">
  163. <a href="">javascript</a>
  164. <a href="">jquery</a>
  165. </div>
  166. </li>
  167. <li class="flexDis">
  168. <div><img src="./static/img/2.png" alt=""></div>
  169. <div class="rightFont flexDis">
  170. <a href="">javascript</a>
  171. <a href="">jquery</a>
  172. </div>
  173. </li>
  174. <li class="flexDis">
  175. <div><img src="./static/img/2.png" alt=""></div>
  176. <div class="rightFont flexDis">
  177. <a href="">html手册</a>
  178. <a href="">css手册</a>
  179. <a href="">html手册</a>
  180. <a href="">css手册</a>
  181. </div>
  182. </li>
  183. <li class="flexDis">
  184. <div><img src="./static/img/2.png" alt=""></div>
  185. <div class="rightFont flexDis">
  186. <a href="">ASP手册</a>
  187. <a href="">bt3手册</a>
  188. </div>
  189. </li>
  190. </ul>
  191. </div>
  192. <div class="content2 container flexDis">
  193. <div class="content_ad_down">
  194. <div class="content_ad">
  195. <img src="./static/img/2.png" alt="">
  196. <a href="">phpstudy急速入门视频</a>
  197. <span></span>
  198. <span></span>
  199. <span></span>
  200. </div>
  201. <div class="content_down">
  202. <div class="down_title">
  203. <span><a href="">更多...</a></span>php工具下载
  204. </div>
  205. <div>
  206. <ul>
  207. <li><span>8-17</span><a href="">小皮面板</a></li>
  208. <li><span>8-17</span><a href="">小皮面板</a></li>
  209. <li><span>8-17</span><a href="">小皮面板</a></li>
  210. <li><span>8-17</span><a href="">小皮面板</a></li>
  211. <li><span>8-17</span><a href="">小皮面板</a></li>
  212. <li><span>8-17</span><a href="">小皮面板</a></li>
  213. <li><span>8-17</span><a href="">小皮面板</a></li>
  214. <li><span>8-17</span><a href="">小皮面板</a></li>
  215. <li><span>8-17</span><a href="">小皮面板</a></li>
  216. </ul>
  217. </div>
  218. </div>
  219. <div class="content_arc">
  220. <div class="arc_title">
  221. <span>技术文章</span>
  222. <span>网站源码</span>
  223. <span>原生手册</span>
  224. <span>推荐博文</span>
  225. </div>
  226. <div class="arc_content">
  227. <ul>
  228. <li><span>php教程</span><a href="">什么是逆波兰式?</a></li>
  229. <li><span>php7</span><a href="">学习php7的革新与性能优化</a></li>
  230. <li><span>php教程</span><a href="">什么是逆波兰式?</a></li>
  231. <li><span>php7</span><a href="">学习php7的革新与性能优化</a></li>
  232. <li><span>php教程</span><a href="">什么是逆波兰式?</a></li>
  233. <li><span>php7</span><a href="">学习php7的革新与性能优化</a></li>
  234. <li><span>php教程</span><a href="">什么是逆波兰式?</a></li>
  235. <li><span>php7</span><a href="">学习php7的革新与性能优化</a></li>
  236. <li><span>php教程</span><a href="">什么是逆波兰式?</a></li>
  237. <li><span>php7</span><a href="">学习php7的革新与性能优化</a></li>
  238. <li><span>php教程</span><a href="">什么是逆波兰式?</a></li>
  239. <li><span>php7</span><a href="">学习php7的革新与性能优化</a></li>
  240. <li><span>php教程</span><a href="">什么是逆波兰式?</a></li>
  241. <li><span>php7</span><a href="">学习php7的革新与性能优化</a></li>
  242. <li><span>php教程</span><a href="">什么是逆波兰式?</a></li>
  243. <li><span>php7</span><a href="">学习php7的革新与性能优化</a></li>
  244. <li><span>php教程</span><a href="">什么是逆波兰式?</a></li>
  245. <li><span>php7</span><a href="">学习php7的革新与性能优化</a></li>
  246. </ul>
  247. </div>
  248. </div>
  249. <div class="content_qa">
  250. <div class="qa_title"><span>社区问答</span></div>
  251. <div class="qa_content">
  252. <ul>
  253. <li><a href="">密码错误</a></li>
  254. <li><a href="">朱老师用的什么屏幕截取软件</a></li>
  255. <li><a href="">编辑页面大不开</a></li>
  256. <li><a href="">密码错误</a></li>
  257. <li><a href="">朱老师用的什么屏幕截取软件</a></li>
  258. <li><a href="">编辑页面大不开</a></li>
  259. <li><a href="">密码错误</a></li>
  260. <li><a href="">朱老师用的什么屏幕截取软件</a></li>
  261. <li><a href="">编辑页面大不开</a></li>
  262. <li><a href="">密码错误</a></li>
  263. <li><a href="">朱老师用的什么屏幕截取软件</a></li>
  264. <li><a href="">编辑页面大不开</a></li>
  265. <li><a href="">密码错误</a></li>
  266. <li><a href="">朱老师用的什么屏幕截取软件</a></li>
  267. <li><a href="">编辑页面大不开</a></li>
  268. <li><a href="">密码错误</a></li>
  269. <li><a href="">朱老师用的什么屏幕截取软件</a></li>
  270. <li><a href="">编辑页面大不开</a></li>
  271. </ul>
  272. </div>
  273. </div>
  274. </div>
  275. <!-- phpstudy -->
  276. <div class="ad2"> <a href=""><img src="./static/img/2.png" alt=""></a></div>
  277. <!-- 底部 -->
  278. <div class="footer">
  279. <div class="footer_left content">
  280. <p class="footer_link">
  281. <a href="">网站首页</a>
  282. <a href="">php视频</a>
  283. <a href="">网站首页</a>
  284. <a href="">php视频</a>
  285. <a href="">网站首页</a>
  286. <a href="">编程词典</a>
  287. </p>
  288. <p class="footer_company">
  289. <span>php中文网:公益在线PHP培训</span>
  290. <img src="static/img/logo,png" alt="">
  291. </p>
  292. <p class="add_tel">
  293. 座机号码:0551-0000000 地址:安徽省合肥市....
  294. </p>
  295. <div class="code">
  296. <img src="./static/img/code1.png" alt="">
  297. <img src="./static/img/code1.png" alt="">
  298. </div>
  299. </div>
  300. </div>
  301. </div>
  302. </div>
  303. </body>
  304. </html>

公共样式代码

  1. * {
  2. margin: 0;
  3. padding: 0;
  4. box-sizing: border-box;
  5. }
  6. html,
  7. body {
  8. width: 100%;
  9. height: 100%;
  10. overflow: hidden;
  11. overflow-y: auto;
  12. font: 14px Helvetica Neue,Helvetica,PingFang SC,微软雅黑,Tahoma,Arial,sans-serif;
  13. background: #F3F5F7;
  14. }
  15. li,dd{
  16. list-style: none;
  17. }
  18. a{
  19. text-decoration: none;
  20. }
  21. button,img{
  22. border: none;
  23. outline: none;
  24. }
  25. /* 过渡动画: */
  26. .navTs{
  27. transition:all 200ms ease;
  28. }
  29. .container {
  30. width: 1200px;
  31. margin: 0 auto;
  32. }
  33. /* 转为flex容器 */
  34. .flexDis {
  35. display: flex;
  36. }
  37. /* flex项目收缩比例:不收缩 */
  38. .flexShrinkStatic {
  39. flex-shrink: 0;
  40. }
  41. /* flex项目收缩比例:等比收缩 */
  42. .flexShrinkAuto {
  43. flex-shrink: 1;
  44. }
  45. /* flex项目放大比例: */
  46. .flexGrowAuto {
  47. flex-grow: 1;
  48. }
  49. /* flex主轴排列:水平排列 */
  50. .flexDir-x {
  51. flex-direction: row;
  52. }
  53. /* flex主轴排列:垂直排列 */
  54. .flexDir-y {
  55. flex-direction: column;
  56. }
  57. /* flex主轴换行:换行 */
  58. .flexWrap {
  59. flex-wrap: wrap;
  60. }
  61. /* flex主轴换行:不换行 */
  62. .flexNoWrap {
  63. flex-wrap: nowrap;
  64. }
  65. /* 主轴水平对齐方式-------------------------------------- */
  66. /* flex主轴对齐方式:左对齐 */
  67. .flexContentS {
  68. justify-content: start;
  69. }
  70. /* flex主轴对齐方式:右对齐 */
  71. .flexContentE {
  72. justify-content: end;
  73. }
  74. /* flex主轴对齐方式:中对齐 */
  75. .flexContentC {
  76. justify-content: center;
  77. }
  78. /* flex主轴对齐方式:均匀排列每个元素,每个元素之间的间隔相等 */
  79. .flexContentV {
  80. justify-content: space-evenly;
  81. }
  82. /* flex主轴对齐方式:均匀排列每个元素,首个元素放置于起点末尾元素放置于终点 */
  83. .flexContentB {
  84. justify-content: space-between;
  85. }
  86. /* flex主轴对齐方式:均匀排列每个元素,元素之前、之间、之后都留有空白的容器内。 */
  87. .flexContentA {
  88. justify-content: space-around;
  89. }
  90. /* 主轴垂直对齐方式-------------------------------------- */
  91. /* 行内上对齐-定义flex子项在flex容器的当前行的侧轴(纵轴)方向上的对齐方式。 */
  92. .flexAlignS {
  93. align-items: start;
  94. }
  95. /* 行内中对齐-定义flex子项在flex容器的当前行的侧轴(纵轴)方向上的对齐方式。 */
  96. .flexAlignC {
  97. align-items: center;
  98. }
  99. /* 行内下对齐-定义flex子项在flex容器的当前行的侧轴(纵轴)方向上的对齐方式。 */
  100. .flexAlignE {
  101. align-items: end;
  102. }
  103. /* 元素位于容器的基线上。-定义flex子项在flex容器的当前行的侧轴(纵轴)方向上的对齐方式。 */
  104. .flexAlignB {
  105. align-items: baseline;
  106. }
  107. /* 默认值。元素被拉伸以适应容器。-定义flex子项在flex容器的当前行的侧轴(纵轴)方向上的对齐方式。 */
  108. .flexAlignT {
  109. align-items: stretch;
  110. }

css样式代码

  1. .header {
  2. max-height: 60px;
  3. font-size: 1em;
  4. }
  5. .header .logo {
  6. display: block;
  7. height: 60px;
  8. width: 140px;
  9. background: url("../img/logo.png") no-repeat center;
  10. background-size: 100%;
  11. margin-left: 2em;
  12. }
  13. .header .nav {
  14. background: #000;
  15. }
  16. .header .nav ul {
  17. padding: 0 1.6em;
  18. margin: 0 3em;
  19. }
  20. .header .nav ul li {
  21. display: inline-block;
  22. }
  23. .header .nav ul li a {
  24. display: inline-block;
  25. text-align: center;
  26. width: 85px;
  27. height: 60px;
  28. line-height: 60px; /* 文本垂直居中 */
  29. color: rgba(255, 255, 255, 0.7);
  30. }
  31. .header .nav ul li:first-of-type {
  32. background-color: #363c41;
  33. }
  34. .header .nav ul li a:hover {
  35. color: rgba(255, 255, 255, 1);
  36. border-bottom: 5px solid #5fb878;
  37. }
  38. .header .nav p {
  39. margin-left: auto;
  40. }
  41. .header .nav p a {
  42. display: inline-block;
  43. width: 60px;
  44. height: 60px;
  45. text-align: center;
  46. line-height: 60px;
  47. color: rgba(255, 255, 255, 0.7);
  48. }
  49. .header .nav p a:hover {
  50. background: #363c41;
  51. }
  52. .top {
  53. height: 510px;
  54. /* border: 5px solid red; */
  55. /* padding: 1em 0; */
  56. margin-top: 20px;
  57. }
  58. .top .menuList {
  59. width: 210px;
  60. /* border: 5px solid blue; */
  61. background: #2b333b;
  62. border-top-left-radius: 0.8em;
  63. border-bottom-left-radius: 0.8em;
  64. }
  65. .top .menuList li {
  66. position: relative;
  67. }
  68. .top .menuList a {
  69. display: inline-block;
  70. width: 100%;
  71. color: rgba(255, 255, 255, 0.8);
  72. margin-top: 0.8em;
  73. padding: 0.85em 1.5em;
  74. font-size: 1.1em;
  75. }
  76. .top .menuList a:hover {
  77. background: rgba(255, 255, 255, 0.2);
  78. }
  79. .top .menuList span {
  80. color: rgba(255, 255, 255, 0.8);
  81. position: absolute;
  82. top: 45%;
  83. right: 10%;
  84. }
  85. /* 搜索 */
  86. .top .search {
  87. background: #fff;
  88. height: 60px;
  89. /* width: 990px; */
  90. border-top-right-radius: 0.8em;
  91. box-shadow: 0 0.2em 0.4em rgba(0, 0, 0, 0.2);
  92. line-height: 60px;
  93. position: relative;
  94. }
  95. .top .search a {
  96. color: #333;
  97. margin: 0 18px;
  98. }
  99. .top .search .span1 {
  100. color: #fff;
  101. background: #ff5722;
  102. border-radius: 0.2em;
  103. position: absolute;
  104. top: 32%;
  105. left: 7.5%;
  106. width: 20px;
  107. height: 20px;
  108. text-align: center;
  109. line-height: 20px;
  110. }
  111. .top .search .span2 {
  112. color: #fff;
  113. background: #2f4056;
  114. border-radius: 0.2em;
  115. position: absolute;
  116. top: 32%;
  117. left: 26.8%;
  118. width: 20px;
  119. height: 20px;
  120. text-align: center;
  121. line-height: 20px;
  122. }
  123. .top .search .span3 {
  124. color: #fff;
  125. background: #ffb800;
  126. border-radius: 0.2em;
  127. position: absolute;
  128. top: 32%;
  129. left: 46%;
  130. width: 20px;
  131. height: 20px;
  132. text-align: center;
  133. line-height: 20px;
  134. }
  135. .top .search .searchInput {
  136. position: absolute;
  137. top: 20%;
  138. right: 20px;
  139. width: 270px;
  140. height: 40px;
  141. background: #f1f0f0;
  142. line-height: 40px;
  143. border-radius: 0.2em;
  144. }
  145. .top .searchInput:hover {
  146. border-bottom: 1px solid silver;
  147. }
  148. .top .searchInput input {
  149. width: 210px;
  150. height: 40px;
  151. outline: none;
  152. /* vertical-align: middle; */
  153. background: none;
  154. border: none;
  155. margin-left: 10px;
  156. }
  157. .top .viewImg {
  158. box-shadow: 0 4px 8px 0 rgba(7, 17, 27, 0.05);
  159. }
  160. .top .viewAd .adImg {
  161. height: 110px;
  162. background: rgba(255, 255, 255, 1);
  163. border-bottom-right-radius: 0.8em;
  164. box-shadow: 0 4px 8px 0 rgba(7, 17, 27, 0.05);
  165. margin-top: -2px;
  166. }
  167. .top .viewAd .adImg img {
  168. border-radius: 0.8em;
  169. }
  170. .ad1 img {
  171. margin: 20px 0;
  172. border-radius: 0.8em;
  173. }
  174. .ad2 img {
  175. margin-bottom: 10px;
  176. border-radius: 0.8em;
  177. }
  178. /* 内容1 */
  179. .content1 {
  180. height: 415px;
  181. }
  182. .content1 h4 {
  183. color: #343535;
  184. border-bottom: 1px dotted #e9e9e9;
  185. padding: 5px;
  186. /* height: 30px; */
  187. }
  188. .content1 .left {
  189. background: rgba(255, 255, 255, 1);
  190. box-shadow: 0 4px 8px 0 rgba(7, 17, 27, 0.05);
  191. border-radius: 0.8em;
  192. padding: 10px;
  193. width: 300px;
  194. }
  195. /* .content1 .left h4{
  196. color: #343535;
  197. border-bottom: 1px dotted #e9e9e9;
  198. padding: 5px;
  199. } */
  200. .content1 .left p {
  201. margin: 10px 0;
  202. }
  203. .content1 .left p a {
  204. margin: 115px 0;
  205. color: #333;
  206. }
  207. .content1 .left p a:hover {
  208. color: #777;
  209. }
  210. .content1 .right {
  211. background: rgba(255, 255, 255, 1);
  212. box-shadow: 0 4px 8px 0 rgba(7, 17, 27, 0.05);
  213. padding: 10px;
  214. border-radius: 0.8em;
  215. width: 260px;
  216. position: relative;
  217. }
  218. .content1 .right h4:last-of-type {
  219. /* background: #000; */
  220. position: absolute;
  221. top: 10px;
  222. right: 10%;
  223. }
  224. .content1 .right .rightImg {
  225. height: 60px;
  226. /* border: 1px solid #000; */
  227. line-height: 60px;
  228. }
  229. .content1 .right .rightImg img {
  230. width: 40px;
  231. margin-left: 5px;
  232. vertical-align: middle;
  233. }
  234. .content1 .right .rightFont {
  235. margin: 8px 5px;
  236. width: 100%;
  237. }
  238. .content1 .right .rightFont a {
  239. margin: 2px;
  240. color: #333;
  241. }
  242. .content1 .right .rightFont a:hover {
  243. color: #777;
  244. }
  245. .content1 .main {
  246. background: rgba(255, 255, 255, 1);
  247. box-shadow: 0 4px 8px 0 rgba(7, 17, 27, 0.05);
  248. border-radius: 0.8em;
  249. margin: 0 10px;
  250. padding: 10px;
  251. /* position: relative; */
  252. max-width: 620px;
  253. }
  254. .content1 .main span {
  255. background: #93999f;
  256. padding: 2px;
  257. color: #fff;
  258. font-size: 0.8em;
  259. margin: 0 5px;
  260. }
  261. .content1 .main ul li {
  262. /* margin: 10px 10px; */
  263. margin: 20px auto;
  264. /* height: 200px; */
  265. /* background: #777; */
  266. }
  267. .content1 .main ul li div {
  268. background: rgba(255, 255, 255, 1);
  269. box-shadow: 0 4px 8px 0 rgba(7, 17, 27, 0.1);
  270. border-radius: 0.7em;
  271. padding: 5px;
  272. /* margin: 15px; */
  273. width: 180px;
  274. height: 70px;
  275. position: relative;
  276. top: 10px;
  277. left: 0;
  278. /* border: 5px solid red; */
  279. }
  280. .content1 .main ul li a {
  281. color: #333;
  282. }
  283. .content1 .main ul li a:hover {
  284. color: #777;
  285. }
  286. .content1 .main ul li div img {
  287. border-radius: 0.8em;
  288. width: 180px;
  289. position: relative;
  290. top: -10px;
  291. left: -5px;
  292. }
  293. /* content2 */
  294. .content2 .content_ad_down {
  295. width: 360px;
  296. /* border: 1px solid red; */
  297. margin: 20px 0;
  298. }
  299. .content2 .content_ad_down .content_ad {
  300. height: 187px;
  301. border-radius: 0.7em;
  302. background: rgba(255, 255, 255, 1);
  303. margin-bottom: 10px;
  304. padding: 1px;
  305. }
  306. .content2 .content_ad_down .content_ad img {
  307. width: 356px;
  308. height: 183px;
  309. border-radius: 0.7em;
  310. }
  311. .content2 .content_ad_down .content_ad a {
  312. display: block;
  313. position: relative;
  314. top: -33px;
  315. left: 0;
  316. background: rgb(0, 0, 0, 0.7);
  317. color: #fff;
  318. width: 300px;
  319. height: 30px;
  320. line-height: 30px;
  321. padding-left: 10px;
  322. }
  323. .content2 .content_ad_down .content_ad span {
  324. display: inline-block;
  325. position: relative;
  326. top: -53px;
  327. left: 305px;
  328. background: rgb(0, 0, 0, 0.7);
  329. color: #fff;
  330. margin: 0 1px;
  331. width: 8px;
  332. height: 10px;
  333. line-height: 30px;
  334. padding-left: 10px;
  335. }
  336. .content2 .content_ad_down .content_down {
  337. background: rgb(255, 255, 255, 1);
  338. border-radius: 0.7em;
  339. position: relative;
  340. /* border: 1px solid red; */
  341. }
  342. .content2 .content_ad_down .content_down .down_title {
  343. font-weight: bold;
  344. height: 33px;
  345. line-height: 33px;
  346. border-bottom: 2px solid rgb(255, 74, 0);
  347. padding-left: 10px;
  348. }
  349. .content2 .content_ad_down .content_down .down_title span {
  350. position: absolute;
  351. top: 0;
  352. right: 8px;
  353. }
  354. .content2 .content_ad_down .content_down .down_title span a {
  355. color: #333;
  356. font-weight: normal;
  357. }
  358. .content2 .content_ad_down .content_down .down_title span a:hover {
  359. color: #777;
  360. }
  361. .content2 .content_ad_down .content_down .down_content {
  362. /* margin-top: 10px;
  363. margin-left: 20px; */
  364. min-height: 260px;
  365. }
  366. .content2 .content_ad_down .content_down .down_content ul li {
  367. list-style: outside;
  368. margin: 10px 20px;
  369. color: #ccc;
  370. }
  371. .content2 .content_ad_down .content_down .down_content span {
  372. /* color: #333; */
  373. position: absolute;
  374. /* top: 10px; */
  375. right: 10px;
  376. }
  377. .content2 .content_ad_down .content_down .down_content a {
  378. color: #333;
  379. }
  380. .content2 .content_ad_down .content_down .down_content a:hover {
  381. color: #777;
  382. }
  383. .content2 .content_arc {
  384. /* border: 1px solid #000; */
  385. width: 510px;
  386. margin: 20px 0;
  387. border-radius: 0.7em;
  388. background: rgba(255, 255, 255, 1);
  389. }
  390. .content2 .content_arc .arc_title {
  391. border-bottom: 1px solid #eaeaea;
  392. height: 35px;
  393. line-height: 35px;
  394. }
  395. .content2 .content_arc .arc_title span {
  396. display: inline-block;
  397. height: 35px;
  398. margin-left: 15px;
  399. cursor: pointer;
  400. color: #333;
  401. }
  402. .content2 .content_arc .arc_title span:first-of-type {
  403. border-bottom: 1px solid #f80303;
  404. }
  405. .content2 .content_arc .arc_content ul li {
  406. margin: 7px 10px;
  407. position: relative;
  408. }
  409. .content2 .content_arc .arc_content ul li span:first-of-type {
  410. display: inline-block;
  411. width: 75px;
  412. /* border: 1px solid red; */
  413. text-align: right;
  414. }
  415. .content2 .content_arc .arc_content ul li span {
  416. margin: 0 3px;
  417. color: #999;
  418. }
  419. .content2 .content_arc .arc_content ul li span:last-of-type {
  420. display: inline-block;
  421. position: absolute;
  422. top: 3px;
  423. right: 5px;
  424. color: #f20b0b;
  425. }
  426. .content2 .content_arc .arc_content ul li a {
  427. margin-left: 2px;
  428. color: #333;
  429. }
  430. .content2 .content_arc .arc_content ul li a:hover {
  431. color: #777;
  432. }
  433. .content2 .content_qa {
  434. width: 310px;
  435. margin: 20px 0;
  436. /* border: 1px solid #000; */
  437. border-radius: 0.7em;
  438. background: rgba(255, 255, 255, 1);
  439. }
  440. .content2 .content_qa .qa_title {
  441. border-bottom: 1px solid #eaeaea;
  442. height: 35px;
  443. line-height: 35px;
  444. }
  445. .content2 .content_qa .qa_title span {
  446. margin-left: 15px;
  447. color: #333;
  448. }
  449. .content2 .content_qa .qa_content ul li {
  450. margin: 10px 20px;
  451. }
  452. .content2 .content_qa .qa_content ul li a {
  453. color: #333;
  454. }
  455. .content2 .content_qa .qa_content ul li a:hover {
  456. color: #777;
  457. }
  458. /* .search-related {
  459. border: 1px solid #000;
  460. } */
  461. .search-related .related_type {
  462. width: 230px;
  463. height: 390px;
  464. /* border: 1px solid lightsalmon; */
  465. }
  466. .search-related .related_type .type_title {
  467. height: 40px;
  468. line-height: 40px;
  469. padding-left: 10px;
  470. font-weight: bold;
  471. color: #666;
  472. background: #eee;
  473. font-size: 12px;
  474. border-right: 1px solid #fff;
  475. }
  476. .search-related .related_type .type_content {
  477. /* display: block; */
  478. height: 320px;
  479. background: #515773;
  480. border-right: 1px solid #fff;
  481. border-bottom-left-radius: 8px;
  482. }
  483. .search-related .related_type .type_content ul li {
  484. padding: 12px 0 0px 20px;
  485. }
  486. .search-related .related_type .type_content ul li a {
  487. color: #fff;
  488. font-size: 14px;
  489. }
  490. .search-related .related_type .type_content ul li a span {
  491. color: #bbbbbb;
  492. font-size: 12px;
  493. padding-left: 5px;
  494. }
  495. /* ------------------------- */
  496. .search-related .related_search {
  497. width: 970px;
  498. height: 390px;
  499. /* margin-bottom: 20px; */
  500. /* border: 1px solid lightseagreen; */
  501. }
  502. .search-related .related_search .search_title {
  503. height: 40px;
  504. line-height: 40px;
  505. padding-left: 10px;
  506. font-weight: bold;
  507. color: #666;
  508. background: #eee;
  509. font-size: 12px;
  510. }
  511. .search-related .related_search .search_title a {
  512. margin-right: 20px;
  513. padding-bottom: 10px;
  514. display: block;
  515. height: 40px;
  516. line-height: 40px;
  517. padding: 0 10px;
  518. font-size: 12px;
  519. font-weight: bold;
  520. color: #666;
  521. }
  522. .search-related .related_search .search_title a:first-of-type {
  523. color: #fff;
  524. background: #515773;
  525. }
  526. .search-related .related_search .search_content {
  527. height: 320px;
  528. background: #515773;
  529. padding: 30px;
  530. border-bottom-right-radius: 8px;
  531. }
  532. .search-related .related_search .search_content .sc_title {
  533. font-size: 2em;
  534. font-weight: bold;
  535. color: #e4e0e0;
  536. margin: 10px auto;
  537. }
  538. .search-related .related_search .search_content .sc_title2 {
  539. margin: 5px auto;
  540. color: #fff;
  541. }
  542. .search-related .related_search .search_content .search_div {
  543. width: 80%;
  544. height: 50px;
  545. line-height: 50px;
  546. margin: 20px auto;
  547. color: #fff;
  548. /* border: 1px solid #000; */
  549. background: #fff;
  550. position: relative;
  551. }
  552. .search-related .related_search .search_content .search_div span:first-of-type {
  553. display: inline-block;
  554. width: 50px;
  555. height: 50px;
  556. color: #333;
  557. text-align: center;
  558. }
  559. .search-related .related_search .search_content .search_div input {
  560. border-style: none;
  561. width: 80%;
  562. height: 48px;
  563. }
  564. .search-related .related_search .search_content .search_div button {
  565. display: block;
  566. border-style: none;
  567. background: none;
  568. height: 50px;
  569. line-height: 50px;
  570. color: #fff;
  571. margin: 0 auto;
  572. }
  573. .search-related .related_search .search_content .search_div span:last-of-type {
  574. position: absolute;
  575. right: 0;
  576. width: 100px;
  577. height: 50px;
  578. background: #98a1ad;
  579. }
  580. .search-related .related_search .search_content .hot_key {
  581. margin-bottom: 25px;
  582. color: #fff;
  583. }
  584. .search-related .related_search .search_content .hot_key span {
  585. display: inline-block;
  586. color: #fff;
  587. background: #898c87;
  588. font-size: 12px;
  589. text-align: center;
  590. border-radius: 8px;
  591. height: 35px;
  592. line-height: 35px;
  593. padding: 0 5px;
  594. margin: 10px;
  595. }
  596. .search-related .related_search .search_content .ls_key {
  597. margin-top: -20px;
  598. color: #fff;
  599. }
  600. .content3 {
  601. background: #fff;
  602. /* border-radius: 8px; */
  603. height: 635px;
  604. }
  605. .content3 .content3_title {
  606. text-align: center;
  607. font-size: 20px;
  608. font-weight: 600;
  609. color: #4d555d;
  610. line-height: 30px;
  611. padding-top: 20px;
  612. padding-bottom: 10px;
  613. }
  614. .content3 .content3_content {
  615. /* border: 1px solid #000; */
  616. padding: 10px;
  617. }
  618. .content3 .content3_content .content_left ul li {
  619. position: relative;
  620. }
  621. .content3 .content3_content .content_left .ct3_left_ad img {
  622. width: 217px;
  623. height: 364px;
  624. border-radius: 8px;
  625. margin-bottom: 18px;
  626. }
  627. .content3 .content3_content .content_left ul li img {
  628. width: 217px;
  629. height: 124px;
  630. border-radius: 8px;
  631. border: none;
  632. }
  633. .content3 .content3_content .content_left ul li span {
  634. position: absolute;
  635. top: 124px;
  636. left: 0;
  637. /* bottom: -50px; */
  638. width: 217px;
  639. height: 42px;
  640. background-color: #fff;
  641. color: #93999f;
  642. font-size: 12px;
  643. line-height: 42px;
  644. padding: 0 20px;
  645. border-bottom-left-radius: 8px;
  646. border-bottom-right-radius: 8px;
  647. box-shadow: 0 4px 8px 0 rgba(7, 17, 27, 0.1);
  648. }
  649. .content3 .content3_content .content_left ul li a {
  650. display: block;
  651. border-radius: 8px;
  652. padding: 15px 20px;
  653. position: absolute;
  654. top: 86px;
  655. transition: top 0.3s;
  656. height: 80px;
  657. width: 217px;
  658. background: #e2e2e2;
  659. color: #555;
  660. }
  661. .content3 .content3_content .content_left ul li a:hover {
  662. color: #333;
  663. top: 45px;
  664. }
  665. /* 点击次数
  666. .content3 .content3_content .content_left ul li span {
  667. position: absolute;
  668. bottom: -36px;
  669. width: 100%;
  670. height: 42px;
  671. background-color: #fff;
  672. color: #93999f;
  673. font-size: 12px;
  674. line-height: 42px;
  675. padding: 0 20px;
  676. border-bottom-left-radius: 8px;
  677. border-bottom-right-radius: 8px;
  678. box-shadow: 0 4px 8px 0 rgba(7, 17, 27, 0.1);
  679. }
  680. .content3 .content3_content .content_left ul li a {
  681. display: block;
  682. border-radius: 8px;
  683. padding: 15px 20px;
  684. position: absolute;
  685. top: 83px;
  686. transition: top 0.3s;
  687. height: 80px;
  688. width: 100%;
  689. background: #e2e2e2;
  690. color: #555;
  691. }
  692. .content3 .content3_content .content_left ul li a:hover {
  693. color: #333;
  694. top: 46px;
  695. } */
  696. .content3 .content3_content .content_right {
  697. width: 100%;
  698. /* border: 1px solid yellowgreen; */
  699. margin-left: 20px;
  700. }
  701. /* 右---------------------------------------- */
  702. .content3 .content3_content .content_right ul li {
  703. position: relative;
  704. /* margin: 30px 5px; */
  705. height: 192px;
  706. }
  707. .content3 .content3_content .content_right ul li img {
  708. width: 217px;
  709. height: 124px;
  710. border-radius: 8px;
  711. border: none;
  712. }
  713. .content3 .content3_content .content_right ul li span {
  714. position: absolute;
  715. top: 124px;
  716. left: 0;
  717. /* bottom: -50px; */
  718. width: 217px;
  719. height: 42px;
  720. background-color: #fff;
  721. color: #93999f;
  722. font-size: 12px;
  723. line-height: 42px;
  724. padding: 0 20px;
  725. border-bottom-left-radius: 8px;
  726. border-bottom-right-radius: 8px;
  727. box-shadow: 0 4px 8px 0 rgba(7, 17, 27, 0.1);
  728. }
  729. .content3 .content3_content .content_right ul li a {
  730. display: block;
  731. border-radius: 8px;
  732. padding: 15px 20px;
  733. position: absolute;
  734. top: 86px;
  735. transition: top 0.3s;
  736. height: 80px;
  737. width: 217px;
  738. background: #e2e2e2;
  739. color: #555;
  740. }
  741. .content3 .content3_content .content_right ul li a:hover {
  742. color: #333;
  743. top: 50px;
  744. }
  745. .footer {
  746. padding: 20px;
  747. background: #393d49;
  748. color: #787d82;
  749. }
  750. .footer .footer_left .footer_link a {
  751. margin: 0 10px;
  752. color: #c8cdd2;
  753. }
  754. .footer .footer_left .footer_link a:hover {
  755. color: #fff;
  756. }
  757. .footer .footer_left .footer_company span {
  758. /* font-size: 11px; */
  759. }
  760. .footer .footer_left .footer_company img {
  761. padding-top: 25px;
  762. width: 50px;
  763. }
  764. .footer .footer_left .copyright img {
  765. padding-top: 25px;
  766. width: 15px;
  767. }
  768. .footer .footer_left .copyright a {
  769. margin: 0 1px;
  770. color: #787d82;
  771. }
  772. .footer .footer_left .copyright a:hover {
  773. color: #fff;
  774. }
  775. .footer .footer_left .add_tel {
  776. padding-top: 25px;
  777. }
  778. .footer .footer_left .code{
  779. position: relative;
  780. }
  781. .footer .footer_left .code img:last-of-type {
  782. margin: 3px;
  783. width: 100px;
  784. position: absolute;
  785. top: -150px;
  786. right: 2%;
  787. }
  788. .footer .footer_left .code img:first-of-type {
  789. margin: 3px;
  790. width: 100px;
  791. position: absolute;
  792. top: -150px;
  793. right: 12%;
  794. }

总结:

  • 学习了flex布局后感觉比较容易上手
  • 可以自适应布局
  • 弹性盒子也比较容易理解
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
Author's latest blog post