Blogger Information
Blog 34
fans 0
comment 0
visits 20521
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
html之常用布局实例
小庄
Original
830 people have browsed it

html之常用布局实例

  1. 1. 制作一个在线QQ客服的固定定位(QQ客服用图片就行)
  2. 2. 仿课堂案例写一个三行三列的定位布局, 色块或边框代表内容就可以;
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Document</title>
  8. <link rel="stylesheet" href="./font_icon_qq/iconfont.css">
  9. </head>
  10. <style>
  11. *{
  12. /* 初始化 */
  13. margin: 0px;
  14. padding: 0;
  15. box-sizing: border-box;
  16. }
  17. header, footer{
  18. height: 5rem;
  19. background-color: lightblue;
  20. }
  21. .container{
  22. width: 80%;
  23. position: relative;
  24. margin: 0.5em auto;
  25. min-height: calc(100vh - 11rem);
  26. }
  27. .container aside{
  28. position: absolute;
  29. width: 200px;
  30. min-height: inherit;
  31. background-color: magenta;
  32. }
  33. /* 左 */
  34. .container aside:first-of-type{
  35. left: 0;
  36. top: 0;
  37. }
  38. /* 中 */
  39. .container main{
  40. position: absolute;
  41. min-height: inherit;
  42. left: 205px;
  43. right: 205px;
  44. background-color: mediumaquamarine;
  45. }
  46. /* 右 */
  47. .container aside:last-of-type{
  48. right: 0;
  49. top: 0;
  50. }
  51. .qq{
  52. position:fixed;
  53. z-index: 999;
  54. left: 2rem;
  55. top: 40rem;
  56. }
  57. </style>
  58. <body>
  59. <header>页眉</header>
  60. <div class="container">
  61. <aside></aside>
  62. <main></main>
  63. <aside></aside>
  64. </div>
  65. <div class="qq">
  66. <div><span class="iconfont icon-qq"></span></div>
  67. <div><span class="iconfont icon-external_qq"></span></div>
  68. </div>
  69. <footer>页脚</footer>
  70. </body>
  71. </html>
Correcting teacher:PHPzPHPz

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!