超级简单的登录注册界面(HTML+CSS)

刚学html和css两天,然后按照小组的要求做了一个简单的登录注册页面。

图片有3张:一张夏目(超级喜欢他),一张渐变背景图,一张二维码。机器人图标是我在阿里巴巴图标库里面找的。

效果图稍微有点不协调,但是越看越习惯,我说的是真的。

效果图如下:

HTML部分

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="http://at.alicdn.com/t/c/font_4075505_xdhq2x9aan.css">
    <title>登录/注册界面</title>
    <link rel="stylesheet" href="page.css">
</head>

<body>
    <div class="box1"><img src="imgs/num2.jpg" alt=""> </div>
    <div class="box2"><img src="imgs/webchat.jpg" alt="" width="100px" height="100px">
        <h4>扫码了解更多<h4></h4>
    </div>
    <form class="container">
        <div class="box4"><span class="iconfont icon-robot-img"></span></div>
        <h1>注册/登录</h1>
        <label for="username">用户名</label>
        <input type="text" id="username" required><br />
        <label for="code">密码 &nbsp;&nbsp; </label>
        <input type="password" id="code" required><br />
        <input type="submit" value="登录"> &nbsp;<input type="submit" value="注册"><br />
        <label for="agree">我已阅读并同意登录/注册<a href="#">服务协议</a> 和<a href="#">隐私保护指引</a></label>
    </form>
</body>

</html>

 CSS部分

 * {
     margin: 0;
     padding: 0;
 }

 a {
     text-decoration: none;
 }

 body {
     background: url(imgs/bg.jpg) no-repeat;
     background-size: cover;
 }

 .box1 {
     position: absolute;
     left: 0;
     top: 0;
     height: 100%;
     opacity: 0.5;
 }

 .box1 img {
     width: 600px;
     height: 929px;
 }

 .box2 {
     position: absolute;
     right: 10px;
     top: 50px;
     opacity: 0.5;
 }

 .box2 img {
     width: 100px;
     height: 100px;
 }

 .box4 {
     position: absolute;
     top: -100px;
     left: 130px;
 }

 .container {
     position: absolute;
     top: 47%;
     left: 58%;
     text-align: center;
 }

 input[type="text"],
 input[type="password"] {
     border-color: pink;
     width: 250px;
     height: 30px;
     margin: 10px;
     padding: 5px;
     border-radius: 5px;
 }

 input[type="submit"] {
     width: 100px;
     height: 30px;
     background-color: #007bff;
     color: #fff;
     border: none;
     border-radius: 5px;
     cursor: pointer;
 }

 input[type="submit"]:hover {
     background-color: #0062cc;
 }

 .iconfont {
     font-size: 120px;
 }

图片素材

 

  • 5
    点赞
  • 23
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
好的,以下是一个简单的示例,你可以根据自己的需求进行修改和美化: ```html <!DOCTYPE html> <html> <head> <title>表白页面</title> <style> body { background: linear-gradient(to bottom, #ff9999, #ff6666); font-family: Arial, sans-serif; color: #fff; text-align: center; padding-top: 50px; } h1 { font-size: 60px; margin-bottom: 50px; } .container { max-width: 800px; margin: 0 auto; padding: 50px; background-color: rgba(255, 255, 255, 0.8); border-radius: 20px; box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3); } form { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; margin-top: 30px; } label { font-size: 24px; margin-right: 20px; } input[type="text"], textarea { font-size: 24px; padding: 10px; border-radius: 10px; border: none; margin-bottom: 20px; width: 100%; max-width: 500px; resize: none; } input[type="submit"] { font-size: 24px; padding: 10px 20px; border-radius: 20px; border: none; background-color: #fff; color: #ff6666; cursor: pointer; transition: all 0.3s ease; } input[type="submit"]:hover { background-color: #ff6666; color: #fff; } </style> </head> <body> <h1>我想对你说...</h1> <div class="container"> <form> <label for="name">你的名字:</label> <input type="text" id="name" name="name" placeholder="请输入你的名字"> <label for="message">表白内容:</label> <textarea id="message" name="message" placeholder="请输入表白内容"></textarea> <input type="submit" value="表白"> </form> </div> <script> const form = document.querySelector('form'); form.addEventListener('submit', function(e) { e.preventDefault(); const name = document.querySelector('#name').value.trim(); const message = document.querySelector('#message').value.trim(); if (name === '' || message === '') { alert('请输入你的名字和表白内容'); } else { alert(`亲爱的 ${name},我想对你说:${message}`); form.reset(); } }); </script> </body> </html> ``` 这个页面包括一个简单的表单,用户可以输入自己的名字和表白内容,然后点击“表白”按钮进行提交。提交后会弹出一个对话框,显示表白的内容。你可以根据自己的需求进行修改和美化。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

一吨土豆

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

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

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

打赏作者

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

抵扣说明:

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

余额充值