Pseudo selectors 23


Hi people;

I have a big problem and I can`t do this. Something us missing and I need your help please!
Here is what I need to dio:::

"Add a third paragraph to the HTML document. On the CSS tab, use nth-child to give it a font size of 26px. Remember: your paragraph is the third paragraph, but the fourth CHILD of body. The h3 counts as the first child!"

Elaboration (help-hint):

That means you'll need to use nth-child(4) to select your paragraph on the CSS tab.
If you're getting strange numbers for your font-size, type Ctrl-0 or Cmd-0 to reset your zoom!
Make sure to leave a space between body :nth-child. If you don't have a space it means "find the body tag that is an nth-child". If you have a space it means "find the nth-child of the body tag".

Here is my code:


This is second image becouse as a new user I can upload only one :smiley:


Never nest heading in paragraphs and vice versa. It is bad practice. And it messes up your count:

  <p>paragraph</p><!-- first child of h3 -->
</h3><!-- first child of body -->
<p>paragraph</p><!-- second child of body -->
<p>paragraph</p><!-- third child of body -->

while if you close your h3 before your paragraph, the heading is first child, the first paragraph second child, and the last paragraph 4th child.


So what do i write in html tab base on my entire code?


I just slove the problem and I think it is very stupid or bug becouse I just put < p > uper head my "third" pharagraf :smiley:


You should close your h3 before the paragraphs:

<h3>closing heading</h3>
<p>first paragraph</p>
<!-- remaining paragraph -->

I never understood why people nested headings in paragraphs and vice versa, if you are writing in a word document, you have a heading first, then one or more paragraphs, then another heading. I never understood why people mess this up when writing html code


still means you are nesting the heading and paragraphs wrong. What you did here is just cheating, SCT (submission correctness test) is unfortunately not catching it. You simple added another paragraph.

from w3:
Each element defined in this specification has a content model: a description of the element's
expected contents. An HTML element must have contents that match the requirements described in the element's content model

Headings does not have paragraphs as expected content.