通过编写猫咪相册应用学习 html - 步骤 54

**告诉我们发生了什么:Step 54我复习的时候又过不去了,不好意思啊。当时是一个程序员帮助解决的。看来我并没有完全明白。
错误原因 ——复选框的 input 元素应该有一个开始标签,而不是一个结束标签。 我没有搞懂错误的原因,开始标签不是已经有了吗?

我从邮箱看到回复了,很高兴。以后能随时提问了。非常感谢。

你目前的代码

<html>
  <body>
    <h1>CatPhotoApp</h1>
    <main>
      <section>
        <h2>Cat Photos</h2>
        <!-- TODO: Add link to cat photos -->
        <p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</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>
            <input type="checkbox"> loving </input>
          </fieldset>
          <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/106.0.0.0 Safari/537.36

挑战: 通过编写猫咪相册应用学习 HTML - 步骤 54

挑战的链接:

这里应该是 <input type="checkbox"> Loving

注意题目要求 Loving 首字母大写。另外,按照示例,

<input> 标签没有结束标签 </input>,你的代码里把结束标签去掉就行了。

在 HTML5 里,这个标签是自闭合标签。我们的新版课程应该是根据新的规范来编写题目,所以我们在旧版课程里可以使用 <input>文本</input>,而在新版课程里不能了。

欢迎你随时提问 :slightly_smiling_face:

1 Like

还有一个问题,对初学者,同时学html css js三个,不会有断节或者夹生的问题吧?我想先粗过一遍,找到感觉,然后再反刍。毕竟动手是第一位的。

谢谢!

1 Like

建议初学者跟着我们的课程结构来学习,先学 HTML、CSS,对“编程是什么”有个大概的印象,然后再学 JS。

学习的时候也可以配套一些文档资料,深入理解知识点,比如在我们的专栏上有各种完整的手册或者具体介绍某个知识点的文章,在左上角搜索框输入关键词即可搜索到:freeCodeCamp 中文编程教程:Python、JavaScript、Java、Git 等

我在学习的时候也用了你这个方法,确实可以先找找感觉,然后再深究一些知识点。