-2

For some reason this little bit of HTML won't show up when I open the file in Chrome, or any other browser for that matter. The code is shown below:

<!DOCTYPE html>

<html>

    <head>

        <title>
            #
        <title>

        <style>



        </style>

    </head>

    <body>

    <table>
        <tr>
            <tb><a href="#">Home</a></tb>
            <tb><a href="#">About</a></tb>
            <tb><a href="#">Freelance</a></tb>
            <tb><a href="#">Contact</a></tb>
        <tr>
    </table>

    </body>

</html>

With that, does anyone know how to make a better menu bar?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • 3
    Where are your `` tags? If you have them, please include them when you say "this is the code"; if not, that might well be your problem. – Nic Feb 09 '15 at 23:24
  • 2
    Maybe because you haven't closed your `` tag, – sideroxylon Feb 09 '15 at 23:27
  • One other problem I'm seeing is that I'm fairly certain it's ``, not ``. – Nic Feb 09 '15 at 23:28
  • Thanks sideroxylon, know I feel stupid, but I thank you very much. I believe that, that did the trick. – Keegan Brown Feb 09 '15 at 23:28
  • We've all been there. Check your `` tags as well, as others have pointed out. – sideroxylon Feb 09 '15 at 23:29
  • thanks all, I guess I'm a little rusty, this is beginner stuff. – Keegan Brown Feb 09 '15 at 23:31
  • Please accept whichever answer helped most, so that this question no longer shows up as unanswered when it actually is. Then let me know when you do so I can delete this ultimately useless comment. – Nic Mar 05 '15 at 13:43

3 Answers3

4

All of the other comments and answers are correct - there are multiple errors in the HTML you've posted.

However, any of those errors will still show SOMETHING on the page.

The error that is causing nothing to show up is simply that you haven't closed your <title> tag. You've got 2 opening tags rather than <title>#</title>

Corrected:

<html>
  <head>
    <title>#</title>
    <style>
    </style>
  </head>
  <body>
    <table>
      <tr>
        <td><a href="#">Home</a></td>
        <td><a href="#">About</a></td>
        <td><a href="#">Freelance</a></td>
        <td><a href="#">Contact</a></td>
      <tr>
    </table>
  </body>
</html>
McAden
  • 13,714
  • 5
  • 37
  • 63
1

As @sideroxylon noticed, you did a major issue when you forgot to close <title> tag. After fixing it you should see all your content.

Additional points:

  1. Your missing <html> surrounding tag.
  2. You wrote <tb> instead of <td>.
  3. You should also use indentation for more readable code.
Orel Eraki
  • 11,940
  • 3
  • 28
  • 36
1

From the comments, I can see three problems with your HTML:

  1. You never closed your <title> tag (all credit to sideroxylon for that) so none of the other HTML will render outside of it.

  2. You wrote <tb> instead of <td>, and <tb> isn't a valid HTML tag. It might function, but using invalid HTML tags is a very bad habit to get into.

  3. You're missing <html> tags. You say that you have them in your actual code, so that's good, but when you post code, please post all of it.

As to a better way to make a header bar, it's probably a better idea to use an unordered list and CSS than a table. There are plenty of tutorials on how to do that -- a simple Google search brings up quite a few. Feel free to choose which is best for you. CSS tends to be easier to manage and customize, as well as producing better-looking results on the end-user's screen, once you get the hang of it.

Community
  • 1
  • 1
Nic
  • 6,211
  • 10
  • 46
  • 69