Web简易发光登录框

效果图

denglu.html文件代码

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>发光登录界面</title>
    <link rel="stylesheet" href="denglu.css" type="text/css">
</head>
<body>
<div id="form1">
    <div id="form2">
        <form  action="" method="post" action="">
            <input id="userid" name="userid" type="text" placeholder="用户名">
            <input id="passwd" name="passwd" type="password" placeholder="密码">
            <input id="login-button" type="button" value="登录" onclick="sclick()" >
        </form>
    </div>
<script>
    function sclick()
    {
        alert('按钮是有用的哦')
    }
</script>
</div>


</body>
</html>

denglu.css文件代码

*
{
    padding: 0;
    margin: 0;
}

body
{
    background-color: #010f1a;
}
#form1
{
    position: absolute;
    left: 60%;
    top:20%;
    width: 30%;
    height: 50%;
    background-color: #00eaff;

    box-shadow:15px 5px 80px  #00eaff;
}

#form2
{
    position: absolute;
    left: 1%;
    right: 1%;
    top:2.5%;
    bottom:2.5%;
    width: 98%;
    height: 95%;
    background-color: #010f1a;

    border-radius: 5%;
    box-shadow:15px 5px 40px -30px #010f1a;
}

#userid
{
    position:absolute;
    left: 20%;
    right: 20%;
    top:20%;
    width: 60%;
    height: 10%;

    box-shadow:0px 0px 10px 6px  #00eaff;
    border: #00eaff;
}

#passwd
{
    position: absolute;
    left: 20%;
    right: 20%;
    top:40%;
    width: 60%;
    height: 10%;
    box-shadow:0px 0px 10px 6px  #00eaff;
    border: #00eaff;
}

#login-button
{
    position: absolute;
    left: 20%;
    right: 20%;
    top:60%;
    width: 60%;
    height: 10%;
    border: #00eaff;
    background-color: #00eaff;
}

补充:让外框每0.5s闪烁一次的js脚本

<script>
    var box1 = document.getElementById('form1');
    var num=0;
    var t1 = setInterval(function() { 
        if(num==0)
        {
            box1.style.backgroundColor = '#00eaff';
            box1.style.boxShadow="15px 5px 80px  #00eaff";

            num=1;
        }
        else if(num==1)
        {
            box1.style.backgroundColor = '#010f1a';
            box1.style.boxShadow="0px 0px 0px #010f1a";
            num=0;
        }
    }, 500)// 每隔0.5秒,1000=1s
</script>

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

予我心安A3

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

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

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

打赏作者

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

抵扣说明:

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

余额充值