I know vertical alignment is always asked about, but I don't seem to be able to find a solution for this particular example. I'd like the text centered within the element, not the element centered itself:
HTML:
<ul>
<li><a href="">I would like this text centered vertically</a></li>
</ul>
CSS:
li a {
width: 300px;
height: 100px;
margin: auto 0;
display: block;
background: red;
}
li a {
width: 300px;
height: 100px;
margin: auto 0;
display: block;
background: red;
}
<ul>
<li><a href="">I would like this text centered vertically</a></li>
</ul>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…