3.常用文字样式.html 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Document</title>
  7. <style>
  8. div {
  9. width: 300px;
  10. height: 300px;
  11. /* 颜色 */
  12. color:#f00;
  13. /* 1.字体大小:16px 根字体
  14. 浏览器可识别的最小字体 12px
  15. font-size:数值px;
  16. 2.字体粗细:font-weight
  17. 粗: bold bolder 600-900
  18. 正常:normal 400 500
  19. 细:lighter 100-300
  20. 3.字体样式:font-style
  21. italic 倾斜
  22. normal 正常
  23. 4.字体:font-family
  24. */
  25. font-weight: 900;
  26. font-size: 30px;
  27. font-style: normal;
  28. font-family: 'Courier New', Courier, monospace;
  29. /* background: #ff0; */
  30. background: rgb(0, 255, 0);
  31. opacity: .3;
  32. /* 透明
  33. opacity <0-1> 对使用的盒子内的元素也具备效果
  34. rgba 只对使用的盒子有效果
  35. */
  36. /* background: rgba(0, 255, 0, 1); */
  37. }
  38. /*
  39. 16进制颜色 rgb rgba(alpha=>透明)<0-1>
  40. #000000 黑色 #000 0,0,0
  41. #ffffff 白色 #fff 255,255,255
  42. #ff0000 红色 #f00 255,0,0
  43. #00ff00 绿色 #0f0 0,255,0
  44. #0000ff 蓝色 #00f 0,0,255
  45. #ffff00 黄色 #ff0 255,255,0
  46. */
  47. </style>
  48. </head>
  49. <body>
  50. <div>
  51. 哈哈哈哈哈
  52. </div>
  53. </body>
  54. </html>