选择具有相同背景的链接后,背景图像消失

时间:2019-04-27 10:52:56

标签: html css

当我单击将用户带到具有相同背景图像的页面的表单上的链接时,该页面不会加载。

此表单是具有密码重置的标准登录并创建新的帐户链接。这三个都共享非常相似的HTML代码,背景图片被加载到正文下方,并在所有三个html之间共享。我不确定这是否属于任何其他已回答的问题,或者我是否公然缺少某些东西

上面是与passwordreset.html和newaccount.html相同的HTML 唯一的区别是其他两个共享“返回登录”链接。

我只是希望图像会在每个HTML之间充当某种常量

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>'Login Form'</title>
    <link rel="stylesheet" type="text/css" href="stylesheet.css">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
</head>

<body>
    <div class="loginbox">
        <i class="fas fa-user fa-7x"></i>
        <h1>Login Here</h1>
        <form>
            <p>Username</p>
            <input type="text" name="" placeholder="Username">
            <p>Password</p>
            <input type="password" name="" placeholder="Password">
            <input type="submit" name="" value="Login">
            <a href="passwordreset.html">Forgot your Password?</a><br>
            <a href="newaccount.html">Create an account</a>
        </form>
    </div>
    </body>
</html>

=================================================

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>'Create New Account'</title>
    <link rel="stylesheet" type="text/css" href="assets/stylesheet/stylesheet.css">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
</head>
<body>
    <div class="loginbox newaccount">
        <i class="fas fa-user fa-7x"></i>
        <h1>Create New Account</h1>
        <form>
            <p>Username</p>
            <input type="text" name="" placeholder="Username">
            <p>Email</p>
            <input type="email" name="" placeholder="Email">
            <p>Password</p>
            <input type="password" name="" placeholder="Password">
            <input type="submit" name="" value="Create">
            <a href="form.html">Back to login screen</a><br>
        </form>
</div>
</body>
</html>

=================================================

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>'Reset Password'</title>
    <link rel="stylesheet" type="text/css" href="assets/stylesheet/stylesheet.css">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
</head>
<body>
<div class="loginbox passwordreset">
    <i class="fas fa-user fa-7x"></i>
    <h1>Password Reset</h1>
    <form>
        <p>Username</p>
        <input type="text" name="" placeholder="Username">
        <p>Email</p>
        <input type="email" name="" placeholder="Email">
        <input type="submit" name="" value="Reset">
        <a href="form.html">Back to login screen</a><br>
    </form>
</div>
</body>
</html>


=================================================
CSS
=================================================


 body{
        margin: 0;
        padding: 0;
        font-family: sans-serif;
        background: url("images/travel.jpg") no-repeat fixed center;
        background-size: cover;
      }


0 个答案:

没有答案