html学习:布局

[复制链接]
 楼主| keer_zu 发表于 2021-3-5 15:26 | 显示全部楼层 |阅读模式
HTML, TE, AC, AD, ck
实例代码:

  1. <!DOCTYPE html>
  2. <html>

  3. <head>
  4. <style>
  5. #header {
  6.     background-color:black;
  7.     color:white;
  8.     text-align:center;
  9.     padding:5px;
  10. }
  11. #aside {
  12.     line-height:30px;
  13.     background-color:#eeeeee;
  14.     height:300px;
  15.     width:100px;
  16.     float:left;
  17.     padding:5px;             
  18. }
  19. #section {
  20.     width:350px;
  21.     float:left;
  22.     padding:10px;                  
  23. }
  24. #footer {
  25.     background-color:black;
  26.     color:white;
  27.     clear:both;
  28.     text-align:center;
  29.    padding:5px;                  
  30. }
  31. </style>
  32. </head>

  33. <body>

  34. <div id="header">
  35. <h1>City Gallery</h1>
  36. </div>



  37. <div id="aside">
  38. London<br>
  39. Paris<br>
  40. Tokyo<br>

  41. </div>



  42. <div id="section">
  43. <h2>London</h2>
  44. <p>
  45. London is the capital city of England.
  46. </p>
  47. <p>
  48. Standing on the River Thames.
  49. </p>
  50. </div>



  51. <div id="footer">
  52. Copyright ? W3Schools.com
  53. </div>



  54. </body>
  55. </html>



html布局就是这么来的。
 楼主| keer_zu 发表于 2021-3-5 15:27 | 显示全部楼层
布局效果是这样的:

218826041dd447ceb9.png
 楼主| keer_zu 发表于 2021-3-5 15:28 | 显示全部楼层
html5布局语义元素:

579556041dd76b5c6b.png
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1474

主题

12900

帖子

55

粉丝
快速回复 返回顶部 返回列表