After researching various solutions to align text within a div
, I have found that many recommend using the vertical-align
property. Despite trying this method, it does not seem to work for my specific case.
.free {
display: inline-block;
-webkit-border-radius: 4;
-moz-border-radius: 4;
border-radius: 4px;
font-family: 'Open Sans', sans-serif;
color: #ff0000;
background: #ffffff;
border: dashed #ff0000 2px;
width: 105px;
height: 46px;
font-size: 1.07rem;
font-weight: bold;
text-align: center;
text-decoration: none;
text-transform: uppercase;
margin-bottom: 0;
}
.free p {
vertical-align: middle;
}
<div class="free">
<p>Text</p>
</div>