Your code does look ok. If you have any add blockers or dark modes enabled in your browser they can cause problems with the tests, which is the most likely issue I think if your code is fine
The code you have shared works on my end. Please ensure that you have disabled any extensions that interface with the freeCodeCamp website (such as Dark Mode and Ad Blocker), and set your browser zoom level to 100%. Both of these factors can cause tests to fail erroneously.
You code works in everyone elses browser including mine. You may have to consider a different course provider. There are plenty to choose from out there, you may have better luck with another