html - 注册/登录容器不会出现在背景图像内
问题描述
我有一个背景图像标签,我希望它填满整个屏幕(包括在我的标题后面,这是我调用的 header.php 文件,但是在这个图像内部,我想在它的中心放置一个注册/登录表单,目前表单只会出现在背景图片下方,请有人帮我看一下CSS并指导我正确的方向。
<!DOCTYPE html>
<html lang="en-GB">
<body>
<header class="clearfix dashboard" style="height: 100vh; background: url(img/loginImage.jpg) no-repeat center center; background-size: cover;">
<?php
require 'header.php';
?>
<div class="container-fluid" id="signup-container">
<div class="wrapper-main">
<section class="form-container">
<?php
// Here we create an error message if the user made an error.
if (isset($_GET["error"])) {
if ($_GET["error"] == "emptyfields") {
echo '<p class="signuperror">Fill in both fields!</p>';
}
else if ($_GET["error"] == "invaliduidmail") {
echo '<p class="signuperror">Invalid username and email!</p>';
}
else if ($_GET["error"] == "invaliduid") {
echo '<p class="signuperror">Invalid username!</p>';
}
else if ($_GET["error"] == "invalidmail") {
echo '<p class="signuperror">Invalid email!</p>';
}
}
?>
<form class="form-signup" action="includes/login.inc.php" method="post">
<input type="text" name="mailuid" placeholder="Email/Username">
<input type="password" name="pwd" placeholder="Password">
<button type="submit" name="login-submit">Login</button>
</form>
<!--Here is the HTML login form.
Notice that the "method" is set to "post" because the data we send is sensitive data.
The "inputs" I decided to have in the form include username/e-mail and password. The user will be able to choose whether to login using e-mail or username. -->
<a class="p-forgetpwd" href="reset-password.php">Forgot your password?</a>
</section>
</div>
</div>
</header>
</body>
</html>
<?php
require 'footer.php';
?>
.wrapper-main {
width: 900px;
margin: 0 auto;
}
/* For the Login/Signup pages */
.form-container {
width: 40%;
padding: 20px;
border-radius: 10%;
background-color: #FFF;
margin-left: 270px;
}
解决方案
问题是你的 header.php 的内容。因为您已将图像放入 , 但随后包含
<?php
require 'header.php';
?>
删除这些行至少应该解决表格不在图像中的问题
推荐阅读
- delphi - delphi 定义具有混合静态和动态元素的 const 多维数组
- java - 自定义页面的 JWT 标记化跳过 URL
- karate - 在空手道中运行功能文件时出现 Java.net.SocketTimeoutException
- angular - 如何根据Angular 8中的登录状态动态隐藏sidenav项目
- prometheus - Prometheus:检测指标的创建(同名,不同标签)
- database - 如何在数据库中持久化 Celery 队列
- c# - 如何获取托管在 ContentControl 中的 UserControl 的父级?
- hygieia - Hygieia 问题:无法在 jenkins 的 hygieia 构建小部件中看到数据
- python - 用 locust 进行负载测试
- php - 如何在 Joomla 3.x 中创建和显示/处理表单