I have a <div>
that is containing a sentence. The height of <div>
is based of %
(its height is changeable - depends on size of screen). Now I want to keep that sentence in the center (vertically) of <div>
, How can I do that?
Here is a sample of what I said:
div{
position:absolute;
border: 1px solid;
width: 250px;
height: 60%;
text-align: center;
}
<div>This should be center vertically</div>