影响 text-align 的元素:其他元素的中心
Elements affecting text-align:center of other elements
这是我的代码。我希望 TimeDisplay
位于同一位置,但标题仍位于 div 的中心。
<html>
<div style="background-color:seagreen; width:100%; height:12.5%; text-align:center; display:table;">
<a style="color:aqua; font-family:Calibri; font-size:4vmax; font-weight:700; text-decoration:none; display:table-cell; vertical-align:middle;" href="Home.html">Soogbad's Website</a>
<h2 id="TimeDisplay" style="color:aqua; font-family:Calibri; font-size:1.25vmax; display:table-cell; vertical-align:middle;">00/00/0000 00:00:00</h2>
</div>
</html>
我该怎么做?
尝试使用 style="position: absolute;"
作为 TimeDisplay
这是我的代码。我希望 TimeDisplay
位于同一位置,但标题仍位于 div 的中心。
<html>
<div style="background-color:seagreen; width:100%; height:12.5%; text-align:center; display:table;">
<a style="color:aqua; font-family:Calibri; font-size:4vmax; font-weight:700; text-decoration:none; display:table-cell; vertical-align:middle;" href="Home.html">Soogbad's Website</a>
<h2 id="TimeDisplay" style="color:aqua; font-family:Calibri; font-size:1.25vmax; display:table-cell; vertical-align:middle;">00/00/0000 00:00:00</h2>
</div>
</html>
我该怎么做?
尝试使用 style="position: absolute;"
作为 TimeDisplay