Can you see any issues with Horizontal... rule tag?

Good Evening guys!
So in this challenge, the system tells me:

" Your solution is incorrect. 

Your HTML code should contain a horizontal rule element.
Expected undefined to be truthy. "

What have i tried ? -
A. To have space between lines and <hr> to keep in the middle.
B. To place <hr> behind the <title> tag .


<!DOCTYPE html>
<html lang="en" dir="ltr">
<head> 
 <title><h1>HTML Challenge</h1><hr></title> 
</head>
  <body>
      <a href="https://developer.mozilla.org/en-US/">Link to MDN Docs</a> 
    <table>
        <tfoot>
            <tr>
                <td>One </td>
                <td>Two</td>
            </tr>
            <tr>
                <td>Three </td>
                <td>Four </td>
           </tr>
       </tfoot>
    </table>
  </body>
  </html>

Hi @Bond007 !

I think your issue is that it is in the head tags.

The head should only contain metadata. (stylesheets, page description, keywords, author, viewport settings, etc.)

Maybe try moving your h1 and hr elements out of the head tags and into the body tags.

1 Like

I couldn’t even expect such a solution from the system ( that in the HTML upper part I have to write description <h1> </h1> ) . I haven’t been thought this way.
Over all thank you for such a point.
Here is the code


<!DOCTYPE html>
<html lang="en" dir="ltr">
  <h1> HTML Challenge</h1>
<head> 
  <title> HTML Challenge</title>
 
</head>
  <body><hr> 
      <a href="https://developer.mozilla.org/en-US/">Link to MDN Documentation</a> 
    <table>
        <tfoot>
            <tr>
                <td>One </td>
                <td>Two</td>
            </tr>
            <tr>
                <td>Three </td>
                <td>Four </td>
           </tr>
       </tfoot>
    </table>
  </body>
  </html>

You could review the FCC html lessons to learn what goes in the body and what goes in the head.

But also, I am not sure why you are not placing the h1 inside the body tags.
Usually, that is where it goes.

https://html.spec.whatwg.org/multipage/sections.html#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements

In the future, it would help alot if you linked the challenge you are working on.

As of right now, none of us knows exactly what the test is looking for because you haven’t provided us with that information.

You will get more responses if you provide all of the information for this challenge. :grinning:

1 Like

Ya, I agree it would make sense to place those tags

in the body- that one was not approved. after only I have added in the upper part in the HTML section . Thank you anyway.

Putting a <h1> into the <head> is a syntax error, and browsers will probably just ignore it.

The <head> doesn’t contain HTML elements like <h1>, <p> or <div>, instead it holds meta-information about the page, links to stylesheets and scripts, the <title> (that’s the text shown in the browser tab, so technically not part of the actual page), and other stuff.

Everything you actually see on the page goes into the <body>, so that’s the place for a <h1> and also for a <hr>.

What challenge are you working on?
What are the error messages telling you?

You keep referencing this challenge but we don’t know what you are working on.

It would be nice if you shared the challenge information with us so we know what you are dealing with :grinning:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.