通过创建猫咪相册应用学习 HTML - 步骤 49

告诉我们发生了什么:

請問要把value屬性是放name後面還是放id後面那邊,有查論壇看兩個相應的,不過都很簡短,麻煩大家 謝謝~

到目前为止你的代码

<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>
        <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">

<!-- User Editable Region -->

          <label><input id="indoor" type="radio" name="indoor-outdoor" value="indoor-outdoor"> Indoor</label>
          <label><input id="outdoor" type="radio" name="indoor-outdoor" value="indoor-outdoor" >Outdoor</label>

<!-- User Editable Region -->

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

你的浏览器信息:

用户代理是: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36

挑战信息:

通过创建猫咪相册应用学习 HTML - 步骤 49

Please put your questions in English, that way it’s better to understand you, because translating online doesn’t work that well. You also need English for programming later, everything is in English. If you’re having trouble writing / reading English, I suggest you use duolingo to learn it quite fast. I’m gonna try to answer your question.

將“值”放在哪裡並不重要。所有屬性都可以隨機放置在元素內。我希望我回答了你的問題。

(It doesn’t matter where you put the “value”. All attributes can be randomly placed within the element. I hope I answered your question.)

欢迎来到论坛 @whire

每个“input”元素的“value”属性都有一个唯一的值。

“id”为“indoor”的“input”的“value”属性值为“indoor”

“id”为“outdoor”的“input”的“value”属性值为“outdoor”

快乐编码