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

210
Visualizações
VS Code Live Server extension adding/duplicating existing HTML element

I'm using the Liver Server extension in VS Code to see the result of some HTML/JS I'm experimenting with, however, it appears Live Server is injecting it's own duplication of one of the HTML elements (in this case an empty div) and joining it onto the bottom of the document. I'm fairly certain Live-Server is the issue here because I've had a look at my code on Codepen and the issue does not appear.

I hope providing a link to Codepen is ok: https://codepen.io/UnmadeBed/pen/PoEoMKy

main.js:

// grab elements from HTML doc
const body = document.querySelector('body');

// container to hold the grid divs
const containerDiv = document.createElement('div');
containerDiv.style.backgroundColor = 'red';
containerDiv.style.height = '500px';
containerDiv.style.width = '500px';
body.appendChild(containerDiv);

const div = document.createElement('div');
containerDiv.appendChild(div);

Chrome dev tools elements tab Additional blue div added by Live Server

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

0

Solved. It turns out I was accidentally styling a hidden div used by Live Server, as opposed to Live Server duplicating anything.

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