在Coursera上自学HTML/CSS。我卡住了。

huangapple go评论59阅读模式
英文:

Teaching myself HTML/CSS in coursera. I'm stuck

问题

我添加了一张图片来描述我的问题:

在Coursera上自学HTML/CSS。我卡住了。

在图片中,您将看到我的HTML代码以及自动评分显示我做错了什么,但问题是我仍然在"body"中有5个"div"标签。我不明白。

在下面的图片中,您将看到Coursera课程逐步要求我做的事情。请帮忙:

在Coursera上自学HTML/CSS。我卡住了。

我已经在"body"中添加了"div"标签,我不明白。

英文:

I added a picture to describe my problem:

在Coursera上自学HTML/CSS。我卡住了。

IN the picture you'll see my HTML code and what the auto grade says I'm doing wrong, but the problem Is that i still have 5 "div" tags in the "body". I don't get it.

In the picture below you'll see what the coursera course wants me to do step by step. Help please:

在Coursera上自学HTML/CSS。我卡住了。

I added the "div" tags in "body", I don't understand.

答案1

得分: 0

你可能误解了问题。根据我的理解,你需要在顶级(即不嵌套)拥有5个<div>标签。

示例:

<body>
    <div>blah 1</div>
    <div>blah 2</div>
    <div>blah 3</div>
    <div>blah 4</div>
    <div>blah 5</div>
</body>

注意:我故意没有给你确切的答案,上面的提示将帮助你继续前进。

英文:

Probably , you've understood the question incorrectly. From my understanding, you need to have 5 &lt;div&gt; tags on top level (i.e. not nested).

Rough e.g.:

&lt;body&gt;
	&lt;div&gt;blah 1&lt;/div&gt;
	&lt;div&gt;blah 2&lt;/div&gt;
	&lt;div&gt;blah 3&lt;/div&gt;
	&lt;div&gt;blah 4&lt;/div&gt;
	&lt;div&gt;blah 5&lt;/div&gt;
&lt;/body&gt;

Note: I'm purposefully not giving you exact answer to your assignment, above hint will help you move forward.

答案2

得分: 0

The grading system is searching for divs that are directly inside the body tag, but your divs are nested inside one div (the first div). To make them accessible, you can modify your code like this:

<body>
  <div>Div1</div>
  <div>Div2</div>
  <div>Div3</div>
  <div>Div4</div>
  <div>Div5</div>
</body>

Hope this helps.

英文:

Well, the issue is that the grading system is searching for divs that are directly inside the body tag. The way you have declared them is called nesting, you have basically nested all your divs inside one div: the first div. As only first div is inside the body tag and the rest of divs are inside the div tag, the grading system is not able to find them. You can modify your code so that your divs are in the body tag. Here's a sample for you

&lt;body&gt;
&lt;div&gt;Div1&lt;/div&gt;
&lt;div&gt;Div2&lt;/div&gt;
&lt;div&gt;Div3&lt;/div&gt;
&lt;div&gt;Div4&lt;/div&gt;
&lt;div&gt;Div5&lt;/div&gt;
&lt;/body&gt;

I hope this helps

答案3

得分: 0

你所做的是添加嵌套的

,像这样:

<div>
内容
<div>
内容
</div>
</div>

但他们要求 5 个独立的

,所以你必须在开始下一个之前关闭每个

。像这样:

<div> 内容 1 </div>
<div> 内容 2 </div>
<div></div>
<div></div>
<div></div>

英文:

What you have done is you have added nested divs like

&lt;div&gt;
   content
&lt;div&gt;
   content
&lt;/div&gt;
&lt;/div&gt;

But they are asking for 5 seperate divs. so you have to close each div before starting the next one.
Like

&lt;div&gt; content 1 &lt;/div&gt;
&lt;div&gt; content 2 &lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;

huangapple
  • 本文由 发表于 2023年6月25日 17:50:46
  • 转载请务必保留本文链接:https://go.coder-hub.com/76549799.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定