I have a doubt, and that is that for a class work I am trying to create as "a Christmas ball" that I turn, the thing is that the ball has already been made and turned, but there is a problem and that is that if the size I give it with em or with px to make bigger or smaller the screen is still the same size the ball, but if I give the size with percentages to be the width greater than the height there is no way to make it fit well and it is stretching or flattening as you move the page. I leave below what I have for you to see what I mean, give it to see in full page and resize the window. Could someone help me to adjust the size to the size of the window and not be deformed? Thanks !!
:root, body {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
box-sizing: border-box;
}
div.bolaNavidad {
left: 10%;
top: 10%;
height: 10%;
width: 5%;
background-image: url(https://preview.ibb.co/n3pJdV/bolamod.png);
background-size: cover;
background-repeat: repeat;
border-radius: 50%;
position: absolute;
box-shadow: -.75em -.25em 0 0 rgba(0,0,0,.1) inset,
.2em .1em 0 0 rgba(255,255,255,.2) inset;
animation: bolas 40s infinite linear;
}
@keyframes bolas {
from {
background-position: left center;
}
to {
background-position: -800px center;
}
}
<!DOCTYPE html>
<html lang="es">
<head>
<title>Navidad</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="css/home.css">
</head>
<body>
<div class="bolaNavidad"></div>
</body>
</hmtl>