Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

177
Views
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 answers
Answer question

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 Report

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!