Blogger Information
Blog 37
fans 2
comment 0
visits 26511
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
1210作业
世纪天城
Original
404 people have browsed it

1.内联样式

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <!-- <link rel="stylesheet" href="style/demo1.css"> -->
  6. <title>布局元素</title>
  7. <style>
  8. body{
  9. margin: 0;
  10. padding: 0;
  11. display: flex;
  12. flex-flow: column;
  13. height: 100vh;
  14. }
  15. header{
  16. width: 100%;
  17. height: 40px;
  18. background-color: black;
  19. box-sizing: border-box;
  20. color: #fff;
  21. line-height: 40px;
  22. padding-left: 20px;
  23. }
  24. .content{
  25. flex: 1;
  26. background-color: cornflowerblue;
  27. display: flex;
  28. }
  29. footer{
  30. width: 100%;
  31. height: 50px;
  32. background-color: coral;
  33. }
  34. aside{
  35. width: 400px;
  36. background-color: darkgoldenrod;
  37. box-sizing: border-box;
  38. padding: 20px;
  39. }
  40. main{
  41. flex: 1;
  42. background-color: darksalmon;
  43. box-sizing: border-box;
  44. padding: 20px;
  45. }
  46. </style>
  47. </head>
  48. <body>
  49. <header>头部</header>
  50. <div class="content">
  51. <aside>侧边栏</aside>
  52. <main>主体内容</main>
  53. </div>
  54. <footer>底部</footer>
  55. </body>
  56. </html>

2.外部样式表
demo1.css代码

  1. body{
  2. background-color: antiquewhite;
  3. margin: 0;
  4. padding: 0;
  5. height: 100vh;
  6. font-size: 20px;
  7. }
  8. header{
  9. width: 100%;
  10. height: 40px;
  11. background-color: black;
  12. color: #fff;
  13. display: flex;
  14. align-items: center;
  15. padding-left: 20px;
  16. box-sizing: border-box;
  17. }
  18. .content{
  19. display: flex;
  20. height: 90vh;
  21. }
  22. aside{
  23. width: 300px;
  24. background-color: darkkhaki;
  25. display: flex;
  26. flex-flow: column;
  27. box-sizing: border-box;
  28. padding: 20px;
  29. }
  30. main{
  31. background-color: darksalmon;
  32. flex: 1;
  33. }
  34. iframe{
  35. width: 100%;
  36. height: 100%;
  37. border: none;
  38. box-sizing: border-box;
  39. padding: 20px;
  40. }
  41. footer{
  42. background-color: darkturquoise;
  43. width: 100%;
  44. height: 50px;
  45. display: flex;
  46. }
  47. html代码
  48. ````html
  49. <!DOCTYPE html>
  50. <html lang="en">
  51. <head>
  52. <meta charset="UTF-8">
  53. <link rel="stylesheet" href="style/demo1.css">
  54. <title>小型网站后台</title>
  55. </head>
  56. <body>
  57. <header>欢迎使用cms后台管理系统</header>
  58. <div class="content">
  59. <aside>
  60. <span>
  61. <a href="ceshi/1.html" target="aside">管理员设置</a>
  62. </span>
  63. <span>
  64. <a href="ceshi/2.html" target="aside">网站安全设置</a>
  65. </span>
  66. </aside>
  67. <main><iframe srcdoc="欢迎使用cms后台管理系统" name="aside" ></iframe></main>
  68. </div>
  69. <footer>底部</footer>
  70. </body>
  71. </html>
  72. `

```
3.小型网站后台图例
小型网站后台图例

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