Why is the following CSS code not centering my button horizontally within a div element?

Why is the following CSS code not centering my button horizontally within a div element? It appears off-center in my webpage:

<!DOCTYPE html>
<html>
<head>
<style>
  .container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .btn {
    background-color: #3498db;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
  }
</style>
</head>
<body>

<div class="container">
  <button class="btn">Click Me</button>
</div>

</body>
</html>

The button seems to be slightly towards the left side within the container. What am I missing in the CSS that is preventing the button from being perfectly centered?

Are you still having this issue? I’ve checked your code in Chrome and Safari on MacOS and it looks like it’s centering fine:

Have a look and mess with it here if you like: https://codepen.io/jwp/pen/mdaJPOJ

Do you have any browser extensions/plugins that could be altering the layout? Posting some screenshots of your inspector in dev tools may help.