<body>
<div class="box">
<span></span>
</div>
</body>
css
<style>
* {
margin: 0;
padding: 0;
}
.box {
width: 100px;
height: 100px;
background: #f40;
position: relative;
margin: 200px auto;
}
.box span{
width: 20px;
height: 20px;
background: pink;
border-radius: 50%;
position: absolute;
left: 50%;
margin-left: -10px;
top:50%;
margin-top: -10px;
}
</style>
<style>
* {
margin: 0;
padding: 0;
}
.box {
width: 100px;
height: 100px;
background: #f40;
margin: 200px auto;
display: flex;
justify-content: center;
align-items: center;
}
.box span{
width: 20px;
height: 20px;
background: pink;
border-radius: 50%;
}
</style>
<style>
* {
margin: 0;
padding: 0;
}
.box {
width: 100px;
height: 100px;
background: #f40;
margin: 200px auto;
display: flex;
}
.box span{
width: 20px;
height: 20px;
background: pink;
border-radius: 50%;
margin: auto;
}
</style>