03.字体的简写属性.html 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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>字体的简写属性</title>
  8. <style>
  9. /*
  10. font 可以设置字体相关的所有属性
  11. 语法:
  12. font:字体大小/行高 字体族
  13. 行高可以省略不写,如果不写会使用默认值
  14. */
  15. div{
  16. border: 1px red solid;
  17. /* height: 2; */
  18. /* font-size: 50px;
  19. font-family: 'Times New Roman', Times, serif; */
  20. /* font: 50px 'Times New Roman', Times, serif; */
  21. /* font: 50px/2 'Times New Roman', Times, serif; */
  22. /* height: 2; */
  23. font:bold italic 50px 'Times New Roman', Times, serif;
  24. /*
  25. font-weight 字重 字体的加粗
  26. 可选值:
  27. normal:默认值,不加粗
  28. bold:加粗
  29. 100-900 九个级别(没什么用)
  30. font-style 字体的风格
  31. normal 正常的
  32. italic 斜体
  33. */
  34. /* font-weight: bold;
  35. font-style: italic; */
  36. }
  37. </style>
  38. </head>
  39. <body>
  40. <div>今天天气真不错 Hello World</div>
  41. </body>
  42. </html>