Paste the text in the p
tag using display:inline-block
. Set vertical-align
to the p
element.
<div> <p>FoxRox</p> </div> div { width: 100px; height: 100px; background: #eee; color: #333; text-align: center; } p { display: inline-block; vertical-align: -80px; }
Demo
source share