07css常见属性.html 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>css常见属性</title>
  6. <style>
  7. #css2{
  8. /*字体颜色*/
  9. color: #eb7350;
  10. /*字体*/
  11. font-family: FangSong;
  12. /*字体粗细*/
  13. font-weight: bold;
  14. /*字体底色*/
  15. background-color: #eb7350;
  16. /*行高*/
  17. line-height: 40px;
  18. }
  19. </style>
  20. </head>
  21. <body>
  22. <h3 style="font: caption;">font的复合属性</h3>
  23. <h3 style=";">font的复合属性</h3>
  24. <h1>行内元素、块级元素、行内块级元素的相互转换</h1>
  25. <h5 style="color: #ff5722">
  26. <p>1.使用style="display: inline"转换为行内元素</p>
  27. <p>2.style="display: block"转换为块级元素</p>
  28. <p>3.style="display: inline-block转换为行内块级元素"</p>
  29. </h5>
  30. <hr>
  31. copyright: <p>Copyright &copy; 2022~ <script>document.write(new Date().getFullYear());</script> <a href="https://grd.net.cn" target="_blank">G.R.D</a> All Rights Reserved.</p> # 左下角的版权声明
  32. <div style="background-color: #a1aec6;width: 100px; height: 100px">
  33. 这是一个块级元素
  34. </div>
  35. <div style="display: inline; background-color: #d3ffe2;width: 100px; height: 100px">
  36. 这是一个块级元素
  37. </div>
  38. <div style="display: inline-block; background-color: #fbd3ff;width: 100px; height: 100px">
  39. 这是一个块级元素
  40. </div>
  41. </body>
  42. </html>