Con CSS Grid
Para centrar un div con Grid Layout definimos body como nuestra etiqueta contenedora y obtenemos el largo de manera dinámica con height: 100vh; viewport height, es decir que cada que se cambie el tamaño del largo este valor se actualizara recalculando la posición de nuestro div.circulo.
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Centrar un DIV con Grid</title>
<style>
body{
display: grid;
place-content: center;
height: 100vh;
}
.circulo{
width: 70px;
height: 70px;
background-color: red;
border-radius: 50%;
}
</style>
</head>
<body>
<div class="circulo"></div>
</body>
</html>
Con CSS Flexbox
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Centrar un DIV con Flexbox</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.cuadro {
width: 70px;
height: 70px;
background-color: blue;
}
</style>
</head>
<body>
<div class="cuadro"></div>
</body>
</html>
Con CSS
Creamos un contenedor del tamaño del ancho width: 100%; y del alto height: 100vh; viewport height del navegador, estos valores son dinámicos es decir en cuanto cambie el tamaño del navegador el contenedor seguirá del tamaño de este., el div lo centramos con top y left calculando el 50% del tamaño del navegador menos la mitad del tamaño del elemento para que nos quede al centro de este.
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Centrar un Div con CSS</title>
<style>
.container {
width: 100%;
height: 100vh;
position: relative;
}
.bredondo{
width: 64px;
height: 64px;
border-radius: 25%;
position: absolute;
background: green;
top: calc(50% - 32px);
left: calc(50% - 32px);
}
</style>
</head>
<body>
<div class="container">
<div class="bredondo"></div>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Centrar un Div con CSS</title>
<style>
.container {
width: 100%;
height: 100vh;
position: relative;
}
.bredondo{
width: 64px;
height: 64px;
border-radius: 25%;
position: absolute;
background: blueviolet;
inset: 0;
margin: auto;
}
</style>
</head>
<body>
<div class="container">
<div class="bredondo"></div>
</div>
</body>
</html>