# 通过编写注册表单学习 html 表单 - 步骤 30

**URL:** <https://forum.freecodecamp.org/t/html-30/587510>\
**Category:** General\
**Tags:** chinese-中文\
**Created:** [January 25, 2023, 1:45pm UTC](https://forum.freecodecamp.org/t/html-30/587510 "2023-01-25T13:45:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![FGFX](https://avatars.discourse-cdn.com/v4/letter/f/ee7513/32.png) [@FGFX](https://forum.freecodecamp.org/u/FGFX)\
**Post date:** [January 25, 2023, 1:45pm UTC](https://forum.freecodecamp.org/t/html-30/587510/1 "2023-01-25T13:45:39Z")

</div>

**告诉我们发生了什么：**  
在此详细描述你的问题。

**你目前的代码**

```html
<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Registration Form</title>
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <h1>Registration Form</h1>
    <p>Please fill out this form with the required information</p>
    <form method="post" action='https://register-demo.freecodecamp.org'>
      <fieldset>
        <label for="first-name">Enter Your First Name: <input id="first-name" type="text" required /></label>
        <label for="last-name">Enter Your Last Name: <input id="last-name" type="text" required /></label>
        <label for="email">Enter Your Email: <input id="email" type="email" required /></label>
        <label for="new-password">Create a New Password: <input id="new-password" type="password" pattern="[a-z0-5]{8,}" required /></label>
      </fieldset>

<!-- User Editable Region -->

      <fieldset>
        <label for="personal-account"><input id="personal-account" type="radio" name="account-type" /> Personal Account</label>
        <label for="business-account"><input id="business-account" type="radio" name="account-type" /> Business Account</label>
        <label for="terms-and-conditions"><input id="terms-and-conditions" type="checkbox" required /> I accept the terms and conditions</label>
      </fieldset>

<!-- User Editable Region -->

      <fieldset></fieldset>
      <input type="submit" value="Submit" />
    </form>
  </body>
</html>

```

```css
/* file: styles.css */
body {
  width: 100%;
  height: 100vh;
  margin: 0;
  background-color: #1b1b32;
  color: #f5f6f7;
}

label {
  display: block;
  margin: 0.5rem 0;
}

```

**你的浏览器信息：**

用户代理是： `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 Edg/108.0.1462.76`

**挑战：** 通过编写注册表单学习 HTML 表单 - 步骤 30

**挑战的链接：**

> **[freeCodeCamp.org](https://www.freecodecamp.org/chinese/learn/2022/responsive-web-design/learn-html-forms-by-building-a-registration-form/step-30)**
>
> 免费学习编程

---

<div class="post-metadata">

**Author:** ![miya](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/miya/32/417705_2.png) [@miya](https://forum.freecodecamp.org/u/miya)\
**Post date:** [January 25, 2023, 4:03pm UTC](https://forum.freecodecamp.org/t/html-30/587510/2 "2023-01-25T16:03:47Z")

</div>

> [@FGFX](#):
>
> `<label for="terms-and-conditions"><input id="terms-and-conditions" type="checkbox" required /> I accept the terms and conditions</label>`

题意是要求给这个 label 中的 terms and conditions 加上一个超链接，你可以先自己尝试写一下代码呢。

如果有问题，请在这个部分描述一下你的问题，以便大家更好地帮助你 🙂

> [@FGFX](#):
>
> **告诉我们发生了什么：**  
> 在此详细描述你的问题。

---

<div class="post-metadata">

**Author:** ![FGFX](https://avatars.discourse-cdn.com/v4/letter/f/ee7513/32.png) [@FGFX](https://forum.freecodecamp.org/u/FGFX)\
**Post date:** [January 26, 2023, 2:52am UTC](https://forum.freecodecamp.org/t/html-30/587510/3 "2023-01-26T02:52:43Z")

</div>

`<a href="https://www.freecodecamp.org/news/terms-of-service">terms-and-conditions</a>`

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 7, 2025, 3:40pm UTC](https://forum.freecodecamp.org/t/html-30/587510/4 "2025-01-07T15:40:34Z")

</div>


