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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. #box1 {
  9. width: 300px;
  10. height: 300px;
  11. /* background: rgba(255, 0, 0,0.6); */
  12. background: #f00;
  13. opacity: .6;
  14. /* font-size: 10px; */
  15. /* font-weight:bolder; */
  16. /* font-family: 'Courier New', Courier, monospace; */
  17. /* font-style: italic; */
  18. color: #000;
  19. }
  20. /*
  21. 透明:opacity:0-1 可以写小数 小数可以省略0 全部透明
  22. 16进制颜色 rgb rgba(a=>alpha<透明>)
  23. 红 #ff0000 #f00 255,0,0 0-1 可以写小数 小数可以省略0 只对使用的元素进行改变
  24. 黄 #ffff00 #ff0 255,255,0
  25. 蓝 #0000ff #00f 0,0,255
  26. 绿 #00ff00 #0f0 0,255,0
  27. 黑 #000000 #000 0,0,0
  28. 白 #ffffff #fff 255,255,255
  29. */
  30. </style>
  31. </head>
  32. <body>
  33. <!--
  34. 颜色:color
  35. 字体大小:浏览器默认字体大小是16px
  36. 浏览器最小可识别 12px
  37. font-size
  38. 字体粗细:font-weight
  39. 粗 bold bolder 600-900
  40. 正常 normal 400-500
  41. 细 lighter 100-300
  42. 字体:font-family
  43. 字体样式:font-style
  44. italic 倾斜
  45. normal 正常
  46. -->
  47. <div id="box1">这是一个新盒子</div>
  48. </body>
  49. </html>