2.样式.html 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. #box {
  9. width: 200px;
  10. height: 200px;
  11. background: #ff0;
  12. margin: 100px auto;
  13. /*
  14. box-shadow:左右 上下 阴影模糊程度 颜色;
  15. */
  16. box-shadow: 100px 140px 10px #f00;
  17. }
  18. p {
  19. font-size: 40px;
  20. font-weight: bold;
  21. color: blue;
  22. /*
  23. text-shadow:左右 上下 阴影模糊程度 颜色;
  24. */
  25. text-shadow: 100px 20px 3px #ff0;
  26. }
  27. #max {
  28. width: 300px;
  29. height: 300px;
  30. border:1px solid #000;
  31. margin: 100px auto;
  32. /* 超出一行显示省略号 */
  33. /* 移除隐藏 */
  34. overflow: hidden;
  35. /* 强制不换行 */
  36. white-space: nowrap;
  37. /* 显示省略号 */
  38. text-overflow: ellipsis;
  39. }
  40. </style>
  41. </head>
  42. <body>
  43. <div id="box"></div>
  44. <p>我是一个文字</p>
  45. <div id="max">
  46. 我是一段文字我是一段文字我是一段文字我是一段文字我是一段文字我是一段文字我是一段文字我是一段文字我是一段文字我是一段文字我是一段文字
  47. 我是一段文字我是一段文字我是一段文字我是一段文字我是一段文字我是一段文字我是一段文字我是一段文字我是一段文字我是一段文字我是一段文字
  48. </div>
  49. </body>
  50. </html>