Hi there, I have a question regarding " You should have at least five code
elements that are descendants of .main-section
elements."
I am not sure how to count the numbers of the descendants of .main-section elements. I am stuck for this for hours, trying to create more elements in .main-section elements but still fail.
I checked the page the project provided, but not understand why it hat at least 5 elements in the .main-section.
Could someone help me? thanks.
@Amy22 welcome to the community!
Can you paste here what your code looks like right now?
how to post the code?
sorry my 1st time to use forum, how can I post the code?
I am trying to paste a section of .main-section in here, hope someone can tell me how to count the descendants, so that I can fullfil the requirement “You should have at least five code
elements that are descendants of .main-section
elements.” Thanks.
No worries. You can check this post on how you could format your code when pasting it here.
I see.
In terms of descendants required by the challenge, it refers to the first level of elements nested within an element (the direct descendants), for example:
<section class="main">
<h1>...</h1>
<p>...</p>
<div>
<h2>...</h2>
<p>...</p>
</div>
</section>
The .main
element above currently have 3 descendants, namely h1
, p
, and div
elements.
I am little confusing, if I add h2, h3, img or div element under .main element, then should it pass?
thanks, I know how to post code now.
Yes, it should pass if the requirement is to have at least 5 direct descendant elements.
BTW, my previous comment intends to explain the concept behind nesting of elements.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.