JSFiddle - React, Tailwind, and code Playground
by Reshad Haddadi
HTML
<div class="wrapper">
<div class="circle">
<div class="content">I want this to be centered vertically in the circle</div>
</div>
</div>
CSS
html,
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
html {
position: absolute;
}
body {
position: relative;
}
.wrapper {
display: table;
}
.circle {
position: absolute;
top: 25%;
left: 25%;
border-radius: 50%;
width: 50%;
height: auto;
padding-top: 50%;
background-color: #403C36;
box-shadow: 1px 0.2px 25px 1px rgba(0, 0, 0, 0.25);
}
.content {
display: table-cell;
position: absolute;
top: 45%;
left: 25%;
width: 50%;
text-align: center;
}