This forum is now read-only. Please use our new forums! Go to forums
Also a first child or...?
In the First Child exercise (16/23), part of the original code looks like so:
<body> <div> <p>I'm the first child!</p> <p>We're not.</p>
Just for giggles, I took out the div element and replaced it with a header element.
<body>
<h3>
<p>I'm the first child!</p>
<p>We're not.</p>
The formatting didn’t carry over in this case. Isn’t the first paragraph element here still the first child of an element(in this case, the h3 element)? The info given in the instructions tells us that, for example,
p:first-child { color: red; } Would make all paragraphs that are the first children of their parent elements red.
But, this isn’t the case if you change the element from a div to something else. Is that an error with CodeAcademy or is something being left out in the instructions?
Answer 559cd0b9e39efeddc30007d1
as demonstrated here in this example, the first paragraph is still becomes red. there are just a few problems:
Never nest a paragraph inside a header (h3) and vice versa. h3 and paragraph are only to designed to hold text.
SCT (submission correctness test), the program that checks your code, can a handle a little creativity, but there is a limit in the creativity if you want to pass the exercise.
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency