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

179
Visualizações
Why text pulse?

I wonder why this text, although it is the same, is pulsating. Any ideas? Looks like a font rendering issue.

setInterval(() => {
  const elem =  document.querySelector('p');
  
  elem.style.display = elem.style.display === 'none' ? '' : 'none';
}, 1000)
p {
  position: absolute;
  color: red;
}
<p>Test</p>
<p>Test</p>

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

0

The reason for this is that text normally is rendered anti-aliased, which means that you have pixels with different transparencies (and possibly also color) at the border of the font to get a smooth look:

enter image description here

The area around the font is therefore up to one pixel larger than it is perceived when you look at it. If you overlay the same text multiple times then it appears to be thicker because the pixels with transparencies overlay and thus reduce the amount of the background to be seen:

enter image description here

When no anti-aliasing (font smoothing) is active you don't see a difference between the reference text and the case where multiple elements overlay (that example might not work for every browser or os):

p {
  position: absolute;
}

* {
  font-smooth: never;
  -webkit-font-smoothing: none;
 }
<p>overlayed text</p>
<p>overlayed text</p>
<p>overlayed text</p>
<p>overlayed text</p>
<div>reference text</div>

With anti-aliasing (font smoothing) is active you can see that the overlayed text looks bolder then the reference text.

p {
  position: absolute;
}
<p>overlayed text</p>
<p>overlayed text</p>
<p>overlayed text</p>
<p>overlayed text</p>
<div>reference text</div>

about 4 years ago · Juan Pablo Isaza Relatório

0

It most probably have to do with anti-aliasing of the font. It causes edges to be semi-transparent, which when overlapped will cause them to be more opaque and therefore more visible.

about 4 years ago · Juan Pablo Isaza Relatório

0

Because the properties on the text changes, right click and inspect element and you will be able to see this:

enter image description here

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