Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

131
Visualizações
why script and div tag could much in html ,bug html and body tag only one

Nice to meet u ,my friend I had find in baidu.com ,cnds,stack overflow,but cannot get answer. I have two question "why script and div tag could much in html",other is "why html and body tag only one in html" Such as

<!DOCTYPE html>
<html lang="en">
<head>
</head>
<head>
</head>
<head>
</head>
<head>
</head>

<body></body>
<body></body>
<body></body>
<body></body>

</html>

can`t be work

But

<!DOCTYPE html>
<html lang="en">

<head>
    <script type="text/javascript">
        document.write("Hello World!")
    </script>
    <script type="text/javascript">
        document.write("Hello World!")
    </script>
    <script type="text/javascript">
        document.write("Hello World!")
    </script>
    <script type="text/javascript">
        document.write("Hello World!")
    </script>
    <script type="text/javascript">
        document.write("Hello World!")
    </script>
</head>

<body></body>

</html>

can be work

Because in the browsers base code? Please tell me why ,thank you very much Your`s friend zt :)

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The HTML specification (unfortunately not transcribed into all languages) might help you out.

Basically an HTML page is structured like a tree.

<html>
  <head>
    // ..metadata, CSS, JS
  </head>
  <body>
    // document elements here
  </body>
</html>
 

The main HTML document can have only one <head> and one <body> element.

<head> includes meta-data, links to CSS, and often - but not always - links to JS scripts and, depending on the app you're creating, there may be lots of CSS and JS. They maybe links to scripts or CSS you've created, or links to scripts or links online, maybe stored in a open-source CDN.

<body> will contain the general markup for the page - all of the elements, the headings, sections, paragraphs etc will be here. It may also contain links to scripts too because sometimes those scripts rely on the document, and its elements, to be loaded first before they can be executed properly.

I suggest trying to read up on some documentation which has been translated into a few languages and small tutorials on how to make an HTML page first though. As you learn, you'll start to understand.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda