英文:
Teaching myself HTML/CSS in coursera. I'm stuck
问题
我添加了一张图片来描述我的问题:
在图片中,您将看到我的HTML代码以及自动评分显示我做错了什么,但问题是我仍然在"body"中有5个"div"标签。我不明白。
在下面的图片中,您将看到Coursera课程逐步要求我做的事情。请帮忙:
我已经在"body"中添加了"div"标签,我不明白。
英文:
I added a picture to describe my problem:
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:
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 <div>
tags on top level (i.e. not nested).
Rough e.g.:
<body>
<div>blah 1</div>
<div>blah 2</div>
<div>blah 3</div>
<div>blah 4</div>
<div>blah 5</div>
</body>
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
<body>
<div>Div1</div>
<div>Div2</div>
<div>Div3</div>
<div>Div4</div>
<div>Div5</div>
</body>
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
<div>
content
<div>
content
</div>
</div>
But they are asking for 5 seperate divs. so you have to close each div before starting the next one.
Like
<div> content 1 </div>
<div> content 2 </div>
<div></div>
<div></div>
<div></div>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论