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>

更多相关文章

  1. QQ在线客服,定位布局
  2. 在线QQ客服的固定定位以及三行三列的定位布局
  3. 运营级在线客服/来客客服/带非常完整的搭建教程/带评价管理
  4. 字体图标,布局与盒模型
  5. HTML注册表单控件实例、CSS模块化理解与CSS基本/上下文选择器的
  6. 前端作业-CSS1
  7. 一个没有JS跟没有连接数据库的表单
  8. html 背景图片全局填充
  9. 微信群活码生成系统,群活码、客服活码、一套非常棒的免费开源群活

随机推荐

  1. Chrome扩展程序开发:使用jQuery修改DOM
  2. html 页面内锚点定位及跳转方法总结
  3. jquery 触发a标签点击事件,弹出页面
  4. 如何防止滚动体内容,并在打开时允许在非画
  5. 如何在jQuery Datatables分页中返回特定
  6. Generation PDF from HTML (component fo
  7. Chrome显示错误为:由于内容安全策略,拒绝
  8. 当您有很多选项时,GUI替代
  9. 单击列表项时如何编写内容? [重复]
  10. JQuery如何获取table中checkBox选中的多