I mean by not using any other tags…just one tag and the CSS for it.
So
<style>
#test{
width: 100px;
height: 100px;
text-align: center;
border: solid 1px #ff0000;
}
</style>
<div id='test'>foo</div>
needs what to center vertically?
Per Answers Below
It needs
display: table-cell;
vertical-align: middle;
There’s a sort of hack-ish work-around where you give the
<div>thedisplay: table-cell;property and then thevertical-align: middle;property, yes.So the complete CSS would be:
Also, external stylesheets are your friends.