Getting border-radius + bg-position to work with an image on Chrome

I think there was a 1px error in your sprite image.

I trimmed off the outer borders and cut away the top half, no longer a sprite.

Using that image I get consistent results with FF and Chrome. Dragging it out of place by -1px -1px intentionally.

When I set bg-position to 0 0, it is the same in both too. You will get rounding errors in both browsers when you zoom in/out. Chrome may have been getting a rounding error on page load with the original image.

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Test Page</title>
<style>

.wraph {
  position: relative;
  width: 606px;
  height: 606px;
  margin-top: 45px;
  border-radius: 25px;
  border: 3px solid red;
  box-sizing: border-box;
  background: url("test.png") no-repeat -1px -1px;
}

</style>

</head>
<body>

<div class="wraph"></div>

</body>
</html>
1 Like