I would like to center this text (Invalid Key) at middle of the page, vertical and horizontal in php code :
if ($_GET['key'] != "lol"){
die("
<center>
<hr>
<h1><b>Invalid Key</b></h1>
<hr>
</center>
");
How, please ? Thank you in advance.
I would like to center this text (Invalid Key) at middle of the page, vertical and horizontal in php code :
if ($_GET['key'] != "lol"){
die("
<center>
<hr>
<h1><b>Invalid Key</b></h1>
<hr>
</center>
");
How, please ? Thank you in advance.
In HTML documents - including those pre-processed by PHP - presentation is handled by CSS (Cascading Stylesheets):
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;
}