我在<body>
标签内有以下的<div>
:
<div id="AlertDiv"><h1>Yes</h1></div>
以下是它们的CSS类:
#AlertDiv {
position:absolute;
height: 51px;
left: 365px;
top: 198px;
width: 62px;
background-color:black;
color:white;
}
#AlertDiv h1{
margin:auto;
vertical-align:middle;
}
如何在<div>
中垂直和水平对齐<h1>
?
<h1>
将比AlertDiv
小。