I am working with the following code:
a {
background: #A9A9A9;
display: block;
position: absolute;
right: 0;
top: 0;
height: 100%;
width: 20%;
vertical-align: middle;
float: right;
text-align: center;
}
a span {
display: inline-block;
vertical-align: middle;
}
<a href="#"><span>Center</span></a>
I am trying to vertically center the span
within the a
element, which is set as position: absolute;
.