HTML程序大全(2):通用注册模版

一、正常情况效果

二、某项没有填写的效果

三、没有勾选同意项的效果

四、代码

<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>注册</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      background-color: #f5f5f5;
    }
    form {
      max-width: 500px;
      margin: 50px auto;
      padding: 40px;
      background-color: #fff;
      box-shadow: 0 2px 4px rgba(0,0,0,0.2);
      border-radius: 6px;
    }
    h1 {
      font-size: 36px;
      text-align: center;
      margin-top: 0;
      color: #2c3e50;
      text-shadow: 1px 1px 0 #fff;
    }
    label {
      display: block;
      margin-bottom: 10px;
      color: #2c3e50;
      text-shadow: 1px 1px 0 #fff;
      font-size: 18px;
    }
    input {
      padding: 10px;
      width: 100%;
      border: 1px solid #ccc;
      border-radius: 4px;
      margin-bottom: 20px;
      box-sizing: border-box;
      font-size: 16px;
      color: #2c3e50;
    }
    input:focus {
      outline: none;
      border-color: #51a6ff;
    }
    input[type="checkbox"] {
      width: auto;
      margin-top: 10px;
      margin-right: 5px;
    }
    button[type="submit"] {
      padding: 12px 24px;
      background-color: #51a6ff;
      color: #fff;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      transition: all 0.3s ease;
      font-size: 20px;
    }
    button[type="submit"]:hover {
      background-color: #0072c6;
    }
    .error {
      color: #ff4d4d;
      font-size: 14px;
      margin-top: 5px;
    }
  </style>
</head>
<body>
  <form>
    <h1>注册</h1>
    <label>用户名:</label>
    <input type="text" name="username" required>
    <label>密码:</label>
    <input type="password" name="password" required>
    <label>确认密码:</label>
    <input type="password" name="confirm_password" required>
    <label>
      <input type="checkbox" name="agree" required>
      我已同意<a href="#">注册协议</a>
    </label>
    <p style="text-align: right;"><button type="submit">注册</button></p>
  </form>
</body>
</html>

相关推荐

  1. HTML程序大全(1):简易计算器

    2023-12-07 08:42:04       41 阅读

最近更新

  1. TCP协议是安全的吗?

    2023-12-07 08:42:04       19 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2023-12-07 08:42:04       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2023-12-07 08:42:04       19 阅读
  4. 通过文章id递归查询所有评论(xml)

    2023-12-07 08:42:04       20 阅读

热门阅读

  1. 【使用uniapp完成微信小程序的图片下载到本机】

    2023-12-07 08:42:04       42 阅读
  2. Vue实战(十):对数组数据的拆分和分组合并

    2023-12-07 08:42:04       39 阅读
  3. 有基础转Go语言学习笔记(2. 基本数据结构篇)

    2023-12-07 08:42:04       33 阅读
  4. C++的文件读写

    2023-12-07 08:42:04       48 阅读
  5. C++11改进观察者模式

    2023-12-07 08:42:04       33 阅读
  6. [leetcode 差分数组] 拼车 M

    2023-12-07 08:42:04       35 阅读
  7. ElasticSearch 查询优化手段有哪些?

    2023-12-07 08:42:04       33 阅读
  8. 持续集成部署-k8s-高级调度-亲和力

    2023-12-07 08:42:04       28 阅读
  9. 图论|841钥匙和房间

    2023-12-07 08:42:04       41 阅读
  10. 安全众测-内网渗透常用的工具和命令

    2023-12-07 08:42:04       41 阅读