Share Code Trang Trí Website Đón Tết

513 từ
3 phút
Share Code Trang Trí Website Đón Tết

Cách sử dụng#

Chỉ cần copy đoạn CSS dưới đây vào file style.css (hoặc trong thẻ <style> của bạn), sau đó paste đoạn HTML vào ngay trước thẻ đóng </body> để đèn lồng hiện lên trên cùng mọi nội dung.

CSS#

@media (max-width: 767.98px) {
.deng-box1 { transform: scale(0.5) rotate(1deg); }
.deng-box2 { transform: scale(0.5) rotate(1deg); }
.deng { top: -65px; }
}
.deng-box1 {
position: fixed;
top: -30px;
left: 5px;
z-index: 9999;
pointer-events: none;
}
.deng-box2 {
position: fixed;
top: -30px;
right: 5px;
z-index: 9999;
pointer-events: none;
}
.deng {
position: relative;
width: 120px;
height: 90px;
margin: 50px;
background: rgba(216, 0, 15, 0.8);
border-radius: 50%;
transform-origin: 50% -100px;
animation: swing 3s ease-in-out infinite;
box-shadow: -5px 5px 50px 4px rgb(250, 108, 0);
}
.deng-box2 .deng {
animation: swing 5s ease-in-out infinite;
box-shadow: -5px 5px 30px 4px rgb(252, 144, 61);
}
.deng::before {
position: absolute;
top: -7px;
left: 29px;
height: 12px;
width: 60px;
content: " ";
display: block;
z-index: 999;
border-radius: 5px 5px 0 0;
border: 1px solid rgb(220, 143, 3);
background: linear-gradient(to right, rgb(220, 143, 3), rgb(255, 165, 0), rgb(220, 143, 3), rgb(255, 165, 0), rgb(220, 143, 3));
}
.deng::after {
position: absolute;
bottom: -7px;
left: 10px;
height: 12px;
width: 60px;
content: " ";
display: block;
margin-left: 20px;
border-radius: 0 0 5px 5px;
border: 1px solid rgb(220, 143, 3);
background: linear-gradient(to right, rgb(220, 143, 3), rgb(255, 165, 0), rgb(220, 143, 3), rgb(255, 165, 0), rgb(220, 143, 3));
}
.xian {
position: absolute;
top: -20px;
left: 60px;
width: 2px;
height: 20px;
background: rgb(220, 143, 3);
}
.deng-a {
width: 100px;
height: 90px;
background: rgba(216, 0, 15, 0.1);
margin: 12px 8px 8px 10px;
border-radius: 50%;
border: 2px solid rgb(220, 143, 3);
}
.deng-b {
width: 45px;
height: 90px;
background: rgba(216, 0, 15, 0.1);
margin: -2px 8px 8px 26px;
border-radius: 50%;
border: 2px solid rgb(220, 143, 3);
}
.deng-t {
font-family: Arial, "Lucida Grande", Tahoma, sans-serif;
font-size: 1.3rem;
color: rgb(255, 165, 0);
font-weight: bold;
line-height: 42px;
text-align: left;
width: 25px;
margin: 5px auto;
}
.shui-a {
position: relative;
width: 5px;
height: 20px;
margin: -5px 0 0 59px;
animation: swing 4s ease-in-out infinite;
transform-origin: 50% -45px;
background: rgb(255, 165, 0);
border-radius: 0 0 5px 5px;
}
.shui-c {
position: absolute;
top: 18px;
left: -2px;
width: 10px;
height: 35px;
background: rgb(255, 165, 0);
border-radius: 0 0 0 5px;
}
.shui-b {
position: absolute;
top: 14px;
left: -2px;
width: 10px;
height: 10px;
background: rgb(220, 143, 3);
border-radius: 50%;
}
@keyframes swing {
0% { transform: rotate(-10deg); }
50% { transform: rotate(10deg); }
100% { transform: rotate(-10deg); }
}

HTML#

<div class="deng-box1">
<div class="deng">
<div class="xian"></div>
<div class="deng-a">
<div class="deng-b"><div class="deng-t"></div></div>
</div>
<div class="shui shui-a"><div class="shui-c"></div><div class="shui-b"></div></div>
</div>
</div>
<div class="deng-box2">
<div class="deng">
<div class="xian"></div>
<div class="deng-a">
<div class="deng-b"><div class="deng-t"></div></div>
</div>
<div class="shui shui-a"><div class="shui-c"></div><div class="shui-b"></div></div>
</div>
</div>

Lời Kết#

Dù Noel còn chưa tới và Tết vẫn còn hơn 2 tháng nữa, nhưng trang trí sớm một chút thì có sao đâu đúng không? Vừa tạo không khí vui tươi, vừa chuẩn bị tinh thần đón năm mới thật rực rỡ. Chúc mọi người những ngày cuối năm ấm áp và website luôn lung linh! 🏮✨🎄

Ủng Hộ & Chia Sẻ

Nếu bài viết này giúp ích cho bạn, hãy chia sẻ hoặc ủng hộ nhé!

Tài Trợ
Share Code Trang Trí Website Đón Tết
https://thinhem.id.vn/posts/share-code-trang-tri-website-ngay-tet/
Tác Giả
Duy Thịnh
Đăng lúc
2025-12-15
Giấy Phép
CC BY-NC-SA 4.0

Bình Luận

Profile Image of the Author
Duy Thịnh
Hello, I'm Thinhem.
Chào mừng đến với blog của tôi 🎉
Đây là nơi mình sẽ chia sẻ những album, cách sắp xếp và tóm tắt tài liệu hàng ngày và tâm sự của mình, hy vọng chúng sẽ hữu ích cho các bạn :)💖
Âm Nhạc
Ảnh Bìa

Âm Nhạc

Không có bài đang phát

0:00 0:00
Không có lời bài hát
Bạn bè
Bình luận mới nhất
Đang tải...
Danh Mục
Thẻ
Thống Kê Trang Web
Bài Viết
26
Danh Mục
9
Thẻ
83
Tổng Số Từ
46,711
Ngày Hoạt Động
0 ngày
Hoạt Động Gần Nhất
0 ngày trước

Mục Lục