Blogger Information
Blog 31
fans 2
comment 0
visits 27681
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
背景常用属性的使用方法
霏梦
Original
761 people have browsed it

- 作者:霏梦

  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>背景各个属性的展示</title>
  7. <style>
  8. .box {
  9. width: 400px;
  10. height: 400px;
  11. /* border: 1px solid red; */
  12. /* border-radius: 15px; */
  13. border-radius: 200px;
  14. /* 背景色 */
  15. background-color: aquamarine;
  16. /* padding: 20px; */
  17. /* 背景裁切 */
  18. background-clip: content-box;
  19. /* background: red; */
  20. /* 渐变化 */
  21. background: linear-gradient(red, yellow);
  22. background: linear-gradient(45deg, red, yellow);
  23. background: linear-gradient(to right, red, yellow);
  24. background: linear-gradient(to left, red, yellow);
  25. background: linear-gradient(to left, red, white, yellow, blue);
  26. background: linear-gradient(
  27. to left,
  28. rgba(255, 0, 0, 0.5),
  29. white,
  30. yellow,
  31. blue
  32. );
  33. background-clip: content-box;
  34. /* 背景图片 */
  35. /* background-image: url("girl.jpg"); */
  36. /* 不重复显示 */
  37. background-repeat: no-repeat;
  38. /* background-repeat: repeat-x; */
  39. /* 固定 */
  40. /* background-attachment: fixed; */
  41. /* 背景定位 */
  42. /* 水平方向和垂直方向 */
  43. /* background-position: 50px 0; */
  44. /* background-position: 50px 50px; */
  45. background-position: right center;
  46. background-position: center right;
  47. /* 只写一个,第二个就是默认center*/
  48. /* background-position: left; */
  49. /* 水平是50% */
  50. background-position: 50% 50%;
  51. background-size: contain;
  52. background-size: cover;
  53. /* 简写 */
  54. background: violet;
  55. /* background: url("girl.jpg") no-repeat right; */
  56. background: url("girl.jpg") no-repeat center;
  57. position: relative;
  58. top: 30px;
  59. left: 30px;
  60. /* 阴影 */
  61. /* box-shadow: 5px 10px 10px #888888; */
  62. /* 外发光 */
  63. /* box-shadow: 0 0 10px #888888; */
  64. }
  65. .box:hover {
  66. /* 外发光 */
  67. box-shadow: 0 0 10px #888888;
  68. cursor: pointer;
  69. }
  70. </style>
  71. </head>
  72. <body>
  73. <div class="box"></div>
  74. </body>
  75. </html>

girl

Correcting teacher:WJWJ

Correction status:qualified

Teacher's comments:总的来说写的不错!
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post