当前位置:   article > 正文

HTML2022年圣诞节专属你的圣诞树来了_圣诞树炫酷网页

圣诞树炫酷网页

圣诞节搞一波,送给专属你或者你的另一半的圣诞树。搞起来!!!!!

  1. <doctype html>
  2. <html lang="en">
  3. <style>
  4. html,body {
  5. width: 100%;
  6. height: 100%;
  7. }
  8. * {
  9. margin: 0;
  10. padding: 0;
  11. }
  12. body {
  13. background-color: #8686a0;
  14. }
  15. .word {
  16. font-size: 22px;
  17. text-align: center;
  18. color: gold;
  19. padding-top: 50px;
  20. letter-spacing: 5px;
  21. text-shadow: 2px 4px 9px rgba(255,255,255,0.7);
  22. }
  23. .word1 {
  24. font-size: 13px;
  25. text-align: center;
  26. color: rgb(235, 17, 206);
  27. padding-top: 50px;
  28. letter-spacing: 5px;
  29. text-shadow: 2px 4px 9px rgba(255,255,255,0.7);
  30. }
  31. .word2 {
  32. font-size: 16px;
  33. text-align: center;
  34. color: rgb(241, 14, 204);
  35. padding-bottom: 50px;
  36. letter-spacing: 5px;
  37. text-shadow: 2px 4px 9px rgba(255,255,255,0.7);
  38. }
  39. /*圣诞树外层div*/
  40. .tree {
  41. width: 200px;
  42. height: 300px;
  43. margin: 80px auto 0 auto;
  44. position: relative;
  45. /*相对定位*/
  46. /* border: 1px solid #fff; */
  47. }
  48. .star {
  49. width: 50px;
  50. height: 50px;
  51. position:absolute;
  52. background-color:#fff;
  53. border-radius:50%;
  54. top:-25px;
  55. z-index:1000;
  56. left:50%;
  57. transform:translateX(-50%);
  58. animation:starLight 1.5s ease infinite alternate;
  59. }
  60. .star-in{
  61. position:absolute;
  62. left:50%;
  63. top:50%;
  64. border-right:100px solid transparent;
  65. border-bottom:70px solid gold;
  66. border-left:100px solid transparent;
  67. transform:translateX(-50%) translateY(-50%) rotate(35deg)
  68. scale(0.14);
  69. }
  70. .star-in:before{
  71. border-bottom: 80px solid gold;
  72. border-left: 30px solid transparent;
  73. border-right: 30px solid transparent;
  74. position:absolute;
  75. top:-45px;
  76. left:-65px;
  77. content:'';
  78. transform:rotate(-35deg);
  79. }
  80. .star-in:after{
  81. border-bottom: 70px solid gold;
  82. border-left: 100px solid transparent;
  83. border-right: 100px solid transparent;
  84. position:absolute;
  85. top:3px;
  86. left:-105px;
  87. content:'';
  88. transform:rotate(-70deg);
  89. }
  90. @keyframes starLight{
  91. 0% {
  92. background: radial-gradient(ellipse at center,
  93. gold 0%, rgba(255, 240, 158, 0.5) 42%,
  94. rgba(129, 125, 102, 0.2) 58%,
  95. rgba(255, 255, 255, 0.1) 100%);
  96. }
  97. 25% {
  98. background: radial-gradient(ellipse at center, gold 0%,
  99. rgba(255, 240, 158, 0.5) 40%,
  100. rgba(255, 242, 173, 0.2) 60%,
  101. rgba(255, 255, 255, 0.1) 100%);
  102. }
  103. 50% {
  104. background: radial-gradient(ellipse at center,
  105. gold 0%, rgba(255, 240, 158, 0.5) 38%,
  106. rgba(255, 242, 173, 0.2) 62%,
  107. rgba(255, 255, 255, 0.1) 100%);
  108. }
  109. 75% {
  110. background: radial-gradient(ellipse at center,
  111. gold 0%, rgba(255, 240, 158, 0.5) 36%,
  112. rgba(255, 242, 173, 0.2) 64%,
  113. rgba(255, 255, 255, 0.1) 100%);
  114. }
  115. 100% {
  116. background: radial-gradient(ellipse at center,
  117. gold 0%, rgba(255, 240, 158, 0.5) 34%,
  118. rgba(255, 242, 173, 0.2) 66%,
  119. rgba(255, 255, 255, 0.1) 100%);
  120. }
  121. }
  122. .leaf{
  123. position:absolute;
  124. left:50%;
  125. top:3%;
  126. margin-left:-30px;
  127. background-color:rgb(24, 143, 24);
  128. width:60px;
  129. height:60px;
  130. border-radius:0 10px 35px 10px ;
  131. transform:rotate(45deg);
  132. box-shadow:2px 7px 2px rgba(43,43,43,0.2);
  133. }
  134. .edge{
  135. position:absolute;
  136. left:0;
  137. bottom:0;
  138. background:rgb(24, 143, 24);
  139. width:25px;
  140. height:30px;
  141. border-radius:0 10px 35px 10px;
  142. transform:translateY(50%) translateX(0);
  143. }
  144. .edge.right{
  145. position:absolute;
  146. left: unset;
  147. bottom: unset;
  148. top: 0;
  149. right: 0;
  150. background:rgb(24, 143, 24);
  151. width:25px;
  152. height:30px;
  153. border-radius:0 10px 35px 10px;
  154. transform:translateY(0) translateX(50%);
  155. }
  156. /*双数修改背景色*/
  157. .leaf:nth-child(even){
  158. background-color: #42cf42;
  159. }
  160. .leaf:nth-child(even) .edge{
  161. background-color: #42cf42;
  162. }
  163. /*最上面*/
  164. .leaf:nth-child(1){
  165. z-index:100;
  166. transform: rotate(45deg) scale(0.8) ;
  167. }
  168. /*第二*/
  169. .leaf:nth-child(2) {
  170. z-index: 99;
  171. top: 15%;
  172. transform: rotate(45deg) scale(1.3) ;
  173. }
  174. .leaf:nth-child(3) {
  175. z-index: 98;
  176. top: 28%;
  177. transform: rotate(45deg) scale(1.6) ;
  178. }
  179. .leaf:nth-child(4) {
  180. z-index: 97;
  181. top: 41%;
  182. transform: rotate(45deg) scale(1.9) ;
  183. }
  184. .leaf:nth-child(5) {
  185. z-index: 96;
  186. top: 54%;
  187. transform: rotate(45deg) scale(2.2) ;
  188. }
  189. .trunk{
  190. width:25px;
  191. height:45px;
  192. border-radius:0 0 3px 3px;
  193. position:absolute;
  194. left:50%;
  195. transform:translateX(-50%);
  196. bottom:20px;
  197. z-index:1;
  198. box-shadow:0 0 10px 5px rgb(19,19,19);
  199. background:linear-gradient(0deg,#6d411b 0%,#5a341d 64%);
  200. }
  201. .ball{
  202. width:20px;
  203. height:20px;
  204. background:#f00;
  205. box-shadow:-1px -1px 6px inset rgb(167, 3, 3),1px 1px 8px inset #f8d9d9;
  206. border-radius:50%;
  207. z-index:101;
  208. position:absolute;
  209. }
  210. .b1{
  211. left: 25%;
  212. top: 30%;
  213. }
  214. .b2 {
  215. left: 35%;
  216. top: 50%;
  217. }
  218. .b3 {
  219. left: 65%;
  220. top: 20%;
  221. }
  222. .b4 {
  223. left: 45%;
  224. top: 22%;
  225. }
  226. .b5 {
  227. left: 40%;
  228. top: 72%;
  229. }
  230. .b6 {
  231. left: 60%;
  232. top: 52%;
  233. }
  234. .b7 {
  235. left: 50%;
  236. top: 62%;
  237. }
  238. .b8 {
  239. left: 80%;
  240. top: 42%;
  241. }
  242. .b9 {
  243. left: 10%;
  244. top: 62%;
  245. }
  246. .b4,.b5,.b6{
  247. background:#ececec;
  248. box-shadow:-1px -1px 6px inset #c9c5c5,1px 1px 8px inset #fff;
  249. }
  250. .b7,.b8,.b9{
  251. background:gold;
  252. box-shadow: -1px -1px 6px inset #aa9208, 1px 1px 8px inset #fff;
  253. }
  254. .sparkle span{
  255. display:block;
  256. position:absolute;
  257. font-size:20px;
  258. z-index:101;
  259. color:#fff;
  260. animation:lights 1.5s ease infinite alternate;
  261. }
  262. /*闪烁动画*/
  263. @keyframes lights{
  264. 0%,100%{
  265. transform:scale(1);
  266. }
  267. 50%{
  268. transform:scale(1.5);
  269. }
  270. }
  271. .sparkle span:nth-child(1) {
  272. left: 30%;
  273. top: 40%;
  274. }
  275. .sparkle span:nth-child(2) {
  276. left: 40%;
  277. top: 27%;
  278. font-size: 15px;
  279. }
  280. .sparkle span:nth-child(3) {
  281. left: 50%;
  282. top: 57%;
  283. font-size: 12px;
  284. }
  285. .sparkle span:nth-child(4) {
  286. left: 70%;
  287. top: 67%;
  288. font-size: 14px;
  289. }
  290. .sparkle span:nth-child(5) {
  291. left: 74%;
  292. top: 13%;
  293. font-size: 16px;
  294. }
  295. .blink div{
  296. width:4px;
  297. height:4px;
  298. background:#fff;
  299. z-index:101;
  300. position:absolute;
  301. border-radius:50%;
  302. animation:blink 1.5s ease infinite alternate;
  303. }
  304. .blink div:nth-child(2) {
  305. left: 34%;
  306. top: 13%;
  307. transform: scale(1.2);
  308. }
  309. .blink div:nth-child(3) {
  310. left: 54%;
  311. top: 43%;
  312. transform: scale(0.7);
  313. }
  314. .blink div:nth-child(4) {
  315. left: 64%;
  316. top: 33%;
  317. transform: scale(1.4);
  318. }
  319. .blink div:nth-child(5) {
  320. left: 34%;
  321. top: 63%;
  322. transform: scale(1.8);
  323. }
  324. .blink div:nth-child(6) {
  325. left: 14%;
  326. top: 76%;
  327. transform: scale(1.6);
  328. }
  329. .blink div:nth-child(7) {
  330. left: 64%;
  331. top: 79%;
  332. transform: scale(1.6);
  333. }
  334. .blink div:nth-child(8) {
  335. left: 80%;
  336. top: 50%;
  337. transform: scale(1.6);
  338. }
  339. .blink div:nth-child(9) {
  340. left: 83%;
  341. top: 20%;
  342. transform: scale(1.6);
  343. }
  344. @keyframes blink {
  345. 0%{
  346. box-shadow:0 0 0 0 #fff;
  347. }
  348. 25% {
  349. box-shadow: 0 0 1px 1px #fff;
  350. }
  351. 50% {
  352. box-shadow: 0 0 2px 2px #fff;
  353. }
  354. 75% {
  355. box-shadow: 0 0 3px 3px #fff;
  356. }
  357. 100% {
  358. box-shadow: 0 0 4px 4px #fff;
  359. }
  360. }
  361. </style>
  362. <head>
  363. <meta charset="UTF-8">
  364. <meta name="筱白爱学习" content="圣诞节快乐">
  365. <title>筱白爱学习</title>
  366. <link rel="stylesheet" href="index.css"/>
  367. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  368. </head>
  369. <body>
  370. <p class="word">声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:【wpsshop博客】
    推荐阅读
    相关标签