I have the following DIV inside a body tag:
<div id="AlertDiv"><h1>Yes</h1></div>
And these are their CSS classes:
#AlertDiv {
position:absolute;
height: 51px;
left: 365px;
top: 198px;
width: 62px;
background-color:black;
color:white;
}
#AlertDiv h1{
margin:auto;
vertical-align:middle;
}
How can I align vertically and horizontally H1 inside DIV?
AlertDiv
will be bigger than H1.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…