网站添加2个春节快乐灯笼挂件

站长 折腾 2023-1-25 3805

直接上代码

css
  1. <style>
  2. .xian {
  3. position: absolute;
  4. top: -20px;
  5. left: 60px;
  6. width: 2px;
  7. height: 20px;
  8. background: #dc8f03;
  9. }
  10. .deng-box {
  11. position: fixed;
  12. top: -30px;
  13. z-index: 999;
  14. }
  15. .deng-box1 {
  16. position: fixed;
  17. top: -30px;
  18. right: 0px;
  19. z-index: 999;
  20. }
  21. .deng-box1 .deng {
  22. position: relative;
  23. width: 120px;
  24. height: 90px;
  25. margin: 50px;
  26. background: #d8000f;
  27. background: rgba(216, 0, 15, 0.9);
  28. border-radius: 50% 50%;
  29. -webkit-transform-origin: 50% -100px;
  30. -webkit-animation: swing 5s infinite ease-in-out;
  31. box-shadow: -5px 5px 50px 4px rgba(250, 108, 0, 1);
  32. }
  33. .deng {
  34. position: relative;
  35. width: 120px;
  36. height: 90px;
  37. margin: 50px;
  38. background: #d8000f;
  39. background: rgba(216, 0, 15, 0.9);
  40. border-radius: 50% 50%;
  41. -webkit-transform-origin: 50% -100px;
  42. -webkit-animation: swing 3s infinite ease-in-out;
  43. box-shadow: -5px 5px 50px 4px rgba(250, 108, 0, 1);
  44. }
  45. .deng-a {
  46. width: 100px;
  47. height: 90px;
  48. background: #d8000f;
  49. background: rgba(216, 0, 15, 0.2);
  50. margin: 12px 8px 8px 8px;
  51. border-radius: 50% 50%;
  52. border: 2px solid #dc8f03;
  53. }
  54. .deng-b {
  55. width: 45px;
  56. height: 90px;
  57. background: #d8000f;
  58. background: rgba(216, 0, 15, 0.2);
  59. margin: -4px 8px 8px 26px;
  60. border-radius: 50% 50%;
  61. border: 2px solid #dc8f03;
  62. }
  63. .shui {
  64. width: 5px;
  65. height: 40px;
  66. background: #ffa500;
  67. border-radius: 0 0 5px 5px;
  68. }
  69. .shui-a {
  70. margin: -10px 0 0 40px;
  71. -webkit-animation: swing 4s infinite ease-in-out;
  72. -webkit-transform-origin: 50% -20px;
  73. }
  74. .shui-b {
  75. margin: -35px 0 0 59px;
  76. -webkit-animation: swing 4s infinite ease-in-out;
  77. -webkit-transform-origin: 50% -45px;
  78. }
  79. .shui-c {
  80. margin: -45px 0 0 77px;
  81. -webkit-animation: swing 4s infinite ease-in-out;
  82. -webkit-transform-origin: 50% -25px;
  83. }
  84. .deng:before {
  85. position: absolute;
  86. top: -7px;
  87. left: 29px;
  88. height: 12px;
  89. width: 60px;
  90. content: " ";
  91. display: block;
  92. z-index: 999;
  93. border-radius: 5px 5px 0 0;
  94. border: solid 1px #dc8f03;
  95. background: #ffa500;
  96. background: linear-gradient(to rightright, #dc8f03, #ffa500, #dc8f03, #ffa500, #dc8f03);
  97. }
  98. .deng:after {
  99. position: absolute;
  100. bottom: -7px;
  101. left: 10px;
  102. height: 12px;
  103. width: 60px;
  104. content: " ";
  105. display: block;
  106. margin-left: 20px;
  107. border-radius: 0 0 5px 5px;
  108. border: solid 1px #dc8f03;
  109. background: #ffa500;
  110. background: linear-gradient(to rightright, #dc8f03, #ffa500, #dc8f03, #ffa500, #dc8f03);
  111. }
  112. .deng-t {
  113. font-family: 华文行楷,Arial,Lucida Grande,Tahoma,sans-serif;
  114. font-size: 2rem;
  115. color: #dc8f03;
  116. font-weight: bold;
  117. line-height: 85px;
  118. text-align: center;
  119. margin-left: -18px;
  120. width: 80px;
  121. }
  122. .night .deng-t,
  123. .night .deng-box,
  124. .night .deng-box1 {
  125. background: transparent !important;
  126. }
  127. @-moz-keyframes swing {
  128. 0% {
  129. -moz-transform: rotate(-10deg)
  130. }
  131. 50% {
  132. -moz-transform: rotate(10deg)
  133. }
  134. 100% {
  135. -moz-transform: rotate(-10deg)
  136. }
  137. }
  138. @-webkit-keyframes swing {
  139. 0% {
  140. -webkit-transform: rotate(-10deg)
  141. }
  142. 50% {
  143. -webkit-transform: rotate(10deg)
  144. }
  145. 100% {
  146. -webkit-transform: rotate(-10deg)
  147. }
  148. }
  149. </style>​

HTML

  1. <!-- 灯笼 1 -->
  2. <div class="deng-box">
  3. <div class="deng">
  4. <div class="xian"></div>
  5. <div class="deng-a">
  6. <div class="deng-b"><div class="deng-t">春节</div></div>
  7. </div>
  8. <div class="shui shui-a"></div>
  9. <div class="shui shui-b"></div>
  10. <div class="shui shui-c"></div>
  11. </div>
  12. </div>
  13. <!-- 灯笼 2 -->
  14. <div class="deng-box1">
  15. <div class="deng">
  16. <div class="xian"></div>
  17. <div class="deng-a">
  18. <div class="deng-b"><div class="deng-t">快乐</div></div>
  19. </div>
  20. <div class="shui shui-a"></div>
  21. <div class="shui shui-b"></div>
  22. <div class="shui shui-c"></div>
  23. </div>
  24. </div>

TAGS

──── 1人觉得很赞 ────
最新回复 (0)
返回