MaxArt 512 days ago. link 1 point ▲ ▼This is off topic. Anyway, the given code *does* render a perfectly centered button. Use button.getBoundingClientRect() to verify that.