【发布时间】:2016-04-02 02:25:33
【问题描述】:
我想将此文本(无效键)居中在页面中间,在 php 代码中垂直和水平:
if ($_GET['key'] != "lol"){
die("
<center>
<hr>
<h1><b>Invalid Key</b></h1>
<hr>
</center>
");
请问如何?提前谢谢你。
【问题讨论】:
我想将此文本(无效键)居中在页面中间,在 php 代码中垂直和水平:
if ($_GET['key'] != "lol"){
die("
<center>
<hr>
<h1><b>Invalid Key</b></h1>
<hr>
</center>
");
请问如何?提前谢谢你。
【问题讨论】:
在 HTML 文档中 - 包括由 PHP 预处理的文档 - 呈现由 CSS(层叠样式表)处理:
PHP:
if ($_GET['key'] != "lol"){
die("
<h1>Invalid Key</h1>
");
CSS:
h1 {
position: relative;
top: calc(50vh - 50px);
height: 56px;
line-height: 56px;
padding: 20px 0;
border-top: 2px solid rgb(120,120,120);
border-bottom: 2px solid rgb(120,120,120);
text-align: center;
font-weight: bold;
}
【讨论】: