Blogger Information
Blog 21
fans 0
comment 0
visits 14723
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
PC 网页布局
Yuming
Original
689 people have browsed it

网页布局

PC 网页布局

  1. <div class="container">
  2. <header>
  3. <a href="#">LOGO</a>
  4. <a href="#">视频</a>
  5. <a href="#">音乐</a>
  6. <a href="#">社区</a>
  7. <a href="#">讨论</a>
  8. <a href="#">直播</a>
  9. <a href="#">登录</a>
  10. </header>
  11. <div class="content">
  12. <aside>左边</aside>
  13. <main>中间</main>
  14. <aside>右边</aside>
  15. </div>
  16. <footer>
  17. <p>版权所欲,翻版必究!</p>
  18. <p>版权所有,翻版必究!-备案号 粤 130********* <a href="#">地址</a></p>
  19. </footer>
  20. </div>
  1. * {
  2. padding: 0;
  3. margin: 0;
  4. box-sizing: border-box;
  5. }
  6. .container {
  7. display: flex;
  8. flex-flow: column nowrap;
  9. min-width: 40em; /*页面的最小宽度不能小于40em*/
  10. /* 页眉 */
  11. header {
  12. height: 50px;
  13. display: flex;
  14. align-items: center;
  15. a {
  16. flex: 0 0 10em; /*不扩展,能收缩 是 flex: 10em;的默认值 ,简单一点就是flex:1; 就是均分,否则*/
  17. text-decoration: none;
  18. color: #999;
  19. text-align: center;
  20. &:first-child {
  21. margin-right: 10em;
  22. }
  23. &:last-child {
  24. margin-left: auto;
  25. }
  26. &:hover:not(:first-child) {
  27. color: rgb(70, 70, 66);
  28. }
  29. }
  30. }
  31. /* 内容 */
  32. .content {
  33. display: flex;
  34. min-height: 30em;
  35. justify-content: center;
  36. aside {
  37. flex: 0 0 200px;
  38. }
  39. main {
  40. flex: 0 0 30em;
  41. }
  42. }
  43. /* 页脚 */
  44. footer {
  45. text-align: center;
  46. a {
  47. text-decoration: none;
  48. color: #999;
  49. }
  50. }
  51. }
  52. // 响应式布局,媒体查询
  53. @media screen and (max-width: 900px) {
  54. .container .content > aside:last-child {
  55. display: none;
  56. }
  57. }
  58. @media screen and (max-width: 700px) {
  59. aside,
  60. footer,
  61. .container header > a:not(:first-child):not(:last-child) {
  62. display: none;
  63. }
  64. }

三种效果

  1. 900px 以上
  2. 700px - 900px
  3. 700px 以下

图片画廊案例 -(响应式布局)选做

… …

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