HTML Height Attribute Error

I need help ! I don’t know what I’m doing wrong…

Here is my task:
Below the piano div, add a new div element with an id attribute of guitar. Nest the following elements within the div:

<h3>Guitar Lessons</h3>
<img src="images/child-guitar.jpg" alt="child with a smile holding a guitar" height="260" width="400">
<p>We teach acoustic guitar, electric guitar, bass guitar, and ukulele. We have guitar lessons for beginners, intermediate players, and advanced players. Improve your skills with weekly lessons. Learn new tips and techniques from experienced instructors. We also have a rock band program that you can join!</p>

Here is my code:

 <div id="guitar">
            <h3>Guitar Lessons</h3>
            <img src="images/child-guitar.jpg" alt="child with a smile holding a guitar" height="260" width= "400">
            <p>We teach acoustic guitar, electric guitar, bass guitar, and ukulele. We have guitar lessons for beginners, intermediate players, and advanced players. Improve your skills with weekly lessons. Learn new tips and techniques from experienced instructors. We also have a rock band program that you can join!</p>
        </div>

Here is error message:
Task: Add a new div element with the id guitar

Test Feedback:

Status: PASSED! Check: 1 Test: The div with the id attribute value of ‘guitar’ within the main element is present in lessons.html. Reason: None

Status: PASSED! Check: 2 Test: The div element with an id attribute of ‘guitar’ contains an h3 element with the text ‘Guitar Lessons’ in lessons.html. Reason: None

Status: FAILED! Check: 3 Test: The div element with an id attribute of ‘guitar’ contains an img element with the specified attributes in lessons.html. Reason: Assertion failed: The height attribute of the img element is incorrect. Error : AssertionError - The height attribute of the img element is incorrect.

Status: PASSED! Check: 4 Test: The div element with an id attribute of ‘guitar’ contains a p element with the specified text in lessons.html. Reason: None

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

yiu switched these two, I guess it wants the code to be exactly as given

No, it was originally height first. I switched it to test and still the same message.

what plattorm are you on?

Hello and welcome to the forum community @Motopvrp !

I am not sure if this is the issue; but try removing the space after the " before height as well as, after the = and before the width to see if that will work for you, maybe.

Wishing you much success! :slightly_smiling_face:

Hello,
Thanks for your reply! The space was also added post edit so, unfortunately, that’s not the issue.

I’m on a GitHub codespace

That doesn’t tell me anything, what are the tests?

1 Like