用原神风格把这个页面美化一下<?php session_start(); if($_SESSION['username']){ echo "欢迎!{$_SESSION['username']}<br>"; } else { echo "<a href='login.php'>登录</a><br>"; echo "<a href='reg.php'>注册</a><br>"; }
时间: 2024-04-06 07:30:22 浏览: 61
php登录注册页面
(在原神风格的背景下,以卷轴形式呈现)
<div class="page">
<img src="background.png" class="background">
<img src="scroll.png" class="scroll">
<div class="content">
<?php session_start(); if($_SESSION['username']){ ?>
<p class="welcome">欢迎!<?php echo $_SESSION['username']; ?></p>
<?php } else { ?>
<a href='login.php' class="button">登录</a>
<a href='reg.php' class="button">注册</a>
<?php } ?>
</div>
</div>
(CSS样式)
.page {
position: relative;
width: 800px;
height: 600px;
margin: 0 auto;
}
.background {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.scroll {
position: absolute;
top: 100px;
left: 100px;
width: 600px;
height: 400px;
}
.content {
position: absolute;
top: 150px;
left: 150px;
width: 500px;
height: 300px;
text-align: center;
}
.welcome {
font-size: 24px;
color: #fff;
}
.button {
display: inline-block;
margin: 20px;
padding: 10px 20px;
font-size: 18px;
color: #fff;
background-color: #7d84a6;
border-radius: 5px;
text-decoration: none;
}
阅读全文