What would be the right and most complete way to start an html document?

Asked

Viewed 105 times

-1

I started an HTML document in Sublime Text 3 and it is possible to type only html:5 and press tab that the initial body of an HTML document appears.

I did the same with VS Code and it already appears tags <meta> the most.

That said, what would be the right and most complete way to start an HTML document?

  • 1

    Recommended reading for vc https://answall.com/questions/209593/qual-%C3%A9-a-fun%C3%A7%C3%A3o-da-meta-tag-x-ua-compatible-dentro-do-html and https://answall.com/questions/309370/howto declarar-e-usar-a-regra-viewport/

  • 2

    It only depends on the purpose. If there was only one "correct" way, the default settings of the browsers would be enough.

1 answer

1

The Boilerplate most basic will always contain a standard document using HTML5 and that has some tags meta, the title and the body:

<!DOCTYPE html>
<html lang="pt-BR">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Título do Documento</title>
  </head>
  <body>
    <!-- Conteúdo HTML do <body> da página. -->
  </body>
</html>

But the initial model really varies a lot from your need and the tools you’ll come to use. If you are going to use Bootstrap in your application, for example, they already offer a template ready here.

You can also use template generators like:

Browser other questions tagged

You are not signed in. Login or sign up in order to post.