I have a question about HTML code

This’s right?

<!DOCTYPE html>
<html>
  <head>

    <meta />

  </head>
  <body>
    <div>
    </div>
  </body>
</html>

I’ve edited your post 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 (’).

1 Like

Well, for it to be correct by standards, the meta element needs an attribute, on its own it doesn nothing. And the head element needs a title element in it

What is this code for?

You can always check the HTML using a validator.

If it’s still able the meta element

Sorry if my English is very basic. Within the Freecodecamp course on HTML language, an example of metadata elements was shown, including <meta/> and I wanted to know if that is ok or was it a page error?

Including ** <meta/> **

this

<meta/>

you need to use backticks for the html tags to show up


the meta element should be included, yes

1 Like

Technically, it is invalid HTML being shown in the example, but I guess it is just to keep it simple.

But we maybe should update the example to be valid HTML.


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