【无标题】蛇年祝福 祝福语见文章链接免费下载

设计了一个简单的HTML界面,使用JavaScript轮询显示蛇年祝福语。以下是完整的代码:

 

html

复制编辑

<!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>蛇年祝福语</title> <style> body { font-family: 'Arial', sans-serif; background-color: #f4f4f9; margin: 0; padding: 0; text-align: center; display: flex; justify-content: center; align-items: center; height: 100vh; } .container { background-color: #fff; padding: 20px; border-radius: 10px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); max-width: 600px; width: 100%; } h1 { color: #4CAF50; font-size: 32px; } .blessing { font-size: 24px; color: #333; margin-top: 20px; } .container button { background-color: #4CAF50; color: white; border: none; padding: 10px 20px; font-size: 16px; cursor: pointer; border-radius: 5px; margin-top: 30px; } .container button:hover { background-color: #45a049; } </style> </head> <body> <div class="container"> <h1>蛇年祝福语</h1> <div class="blessing" id="blessingText"> <!-- 初始祝福语 --> </div> <button onclick="nextBlessing()">显示下一个祝福</button> </div> <script> const blessings = [ "蛇年大吉,事业腾飞", "蛇年如意,财源广进", "蛇年安康,平安幸福", "蛇年吉祥,万事如意", "蛇年好运,步步高升", "蛇年福到,运势旺盛", "蛇年顺心,财运亨通", "蛇年喜庆,吉星高照", "蛇年幸福,家庭美满", "蛇年瑞气,福星高照", "蛇年富贵荣华,家和万事兴", "蛇年春风得意,笑容满面", "蛇年一帆风顺,富贵荣华", "蛇年心如止水,万事如意", "蛇年吉星高照,财源滚滚", "蛇年吉祥如意,财源滚滚" ]; let currentBlessing = 0; function nextBlessing() { document.getElementById('blessingText').innerHTML = blessings[currentBlessing]; currentBlessing = (currentBlessing + 1) % blessings.length; } // 默认显示第一个祝福语 nextBlessing(); </script> </body> </html>

说明:

  1. HTML部分:包含一个标题、祝福语显示区域和一个按钮。
  2. CSS部分:使界面更加美观,设置了背景色、字体、按钮样式等。
  3. JavaScript部分:存储祝福语数组,并通过点击按钮轮流显示祝福语。

如何使用:

  1. 将此代码保存为 .html 文件。
  2. 打开文件时,页面将显示一个祝福语,点击按钮将轮流显示列表中的下一个祝福语。

祝福语 100个左右

【免费】蛇年祝福和蛇年祝福的代码资源-优快云文库https://download.youkuaiyun.com/download/matlab_python22/90291514

 

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

交通上的硅基思维

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值