# 通過編寫貓咪相冊應用學習 HTML - 步驟 56

**URL:** <https://forum.freecodecamp.org/t/html-56/613576>\
**Category:** General\
**Tags:** chinese-中文\
**Created:** [June 2, 2023, 12:08pm UTC](https://forum.freecodecamp.org/t/html-56/613576 "2023-06-02T12:08:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ASTABURKE](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/astaburke/32/319606_2.png) [@ASTABURKE](https://forum.freecodecamp.org/u/ASTABURKE)\
**Post date:** [June 2, 2023, 12:08pm UTC](https://forum.freecodecamp.org/t/html-56/613576/1 "2023-06-02T12:08:52Z")

</div>

**告訴我們發生了什麼：**  
在此詳細描述你的問題。

**你目前的代碼**

```html
<html>
  <body>
    <main>
      <h1>CatPhotoApp</h1>
      <section>
        <h2>Cat Photos</h2>
        <!-- TODO: Add link to cat photos -->
        <p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
        <a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
      </section>
      <section>
        <h2>Cat Lists</h2>
        <h3>Things cats love:</h3>
        <ul>
          <li>cat nip</li>
          <li>laser pointers</li>
          <li>lasagna</li>
        </ul>
        <figure>
          <img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/lasagna.jpg" alt="A slice of lasagna on a plate.">
          <figcaption>Cats <em>love</em> lasagna.</figcaption>  
        </figure>
        <h3>Top 3 things cats hate:</h3>
        <ol>
          <li>flea treatment</li>
          <li>thunder</li>
          <li>other cats</li>
        </ol>
        <figure>
          <img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/cats.jpg" alt="Five cats looking around a field.">
          <figcaption>Cats <strong>hate</strong> other cats.</figcaption>  
        </figure>
      </section>
      <section>
        <h2>Cat Form</h2>
        <form action="https://freecatphotoapp.com/submit-cat-photo">
          <fieldset>
            <legend>Is your cat an indoor or outdoor cat?</legend>
            <label><input id="indoor" type="radio" name="indoor-outdoor" value="indoor"> Indoor</label>
            <label><input id="outdoor" type="radio" name="indoor-outdoor" value="outdoor"> Outdoor</label>
          </fieldset>
          <fieldset>
            <legend>What's your cat's personality?</legend>

<!-- User Editable Region -->

     <label>
 <input id="loving" type="checkbox"> for="Loving" 
    </label>

<!-- User Editable Region -->

          </fieldset>
          <input type="text" name="catphotourl" placeholder="cat photo URL" required>
          <button type="submit">Submit</button>
        </form>
      </section>
    </main>
  </body>
</html>

```

**你的瀏覽器信息：**

用戶代理是： `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5 Safari/605.1.15`

**挑戰：** 通過編寫貓咪相冊應用學習 HTML - 步驟 56

**挑戰的鏈接：**

> **[freeCodeCamp.org](https://www.freecodecamp.org/chinese-traditional/learn/2022/responsive-web-design/learn-html-by-building-a-cat-photo-app/step-56)**
>
> 免費學習編程

---

<div class="post-metadata">

**Author:** ![Simp](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/simp/32/319604_2.png) [@Simp](https://forum.freecodecamp.org/u/Simp)\
**Post date:** [June 2, 2023, 12:12pm UTC](https://forum.freecodecamp.org/t/html-56/613576/2 "2023-06-02T12:12:57Z")

</div>

Hey, due to the language barrier, it’s really hard for me or other people to help you out. I would suggest you translate your question to a universal language like English, which the vast majority understands. Thankyou

---

<div class="post-metadata">

**Author:** ![stephenmutheu](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/stephenmutheu/32/421476_2.png) [@stephenmutheu](https://forum.freecodecamp.org/u/stephenmutheu)\
**Post date:** [June 2, 2023, 12:15pm UTC](https://forum.freecodecamp.org/t/html-56/613576/3 "2023-06-02T12:15:49Z")

</div>

您应该将文本 Loving 嵌套在标签元素中。 然后给元素一个与输入id值相同的for属性。

---

<div class="post-metadata">

**Author:** ![WongYC-66](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/wongyc-66/32/317176_2.png) [@WongYC-66](https://forum.freecodecamp.org/u/WongYC-66)\
**Post date:** [June 5, 2023, 2:29pm UTC](https://forum.freecodecamp.org/t/html-56/613576/4 "2023-06-05T14:29:49Z")

</div>

如果我有一个 这样子的 `<input>` element,

`<input id="indoor" type="checkbox">`

和一个这样的text:

`click me!`

当我想要别人点击这个 click me! 后， 那个#indoor 的checkbox 会自动勾选。  
我会这么做：

`<label for="indoor"> click me! </label>`

---

<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, 11:58am UTC](https://forum.freecodecamp.org/t/html-56/613576/5 "2025-01-07T11:58:49Z")

</div>

Closed on January 7, 2025, 11:58am UTC


