如何阻止我的视差叠加层干扰我的表单和链接字段?

时间:2018-02-14 02:31:41

标签: html css parallax

我已经在我的PHP网站的索引页面中实现了简单的视差图像。出于某种原因,登录表单由于我实现的视差标题而行为不正常。在那张照片上有一个由div命名的图像叠加层,我将其命名为logo。我可以肯定它是罪魁祸首,因为当我评论它时,表单字段和链接工作。该网站位于http://www.mattmacy.com/greenia/。请注意表单字段不起作用。我已经为我的3张图片和徽标类包含了我的CSS。任何帮助将不胜感激。

<!DOCTYPE html>
<html>
<head>
<title>FORUM</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>

<body style="background-color: maroon";>
<div style= "background-color: gold; border-style: solid;">

//This "logo" div stops my form and link fields from working  
<div class="pimg1">
<div class="logo"></div>
</div>

<div style="background-color: gold; border-style: solid;">
<h1>Matt Macy's Forum</h1>

<?php
session_start();
if (!isset($_SESSION['uid'])){
echo "<form action='login_parse.php' method='post'>
Username: <input type='text' name='username' />&nbsp;
Password: <input type='password' name='password' />&nbsp;
<input type='submit' name='submit' value='Log In'/></form>";
echo "You can joing this site with Admin approval <a 
href='register.php' class='Links'>Register</a>";
}else {
    echo "You are logged in as ". $_SESSION['username']. "with a level 
of " . $_SESSION['level']."<a href='logout_parse.php' 
class='Links'>Logout</a>";
}   if (isset($_SESSION['level']) && ($_SESSION['level'] == 'Admin')){
        echo "<a href='authenticate.php' 
class='authenticate'>Authenticate</a>";
        echo "<a href='postAudiowithPayPal.php' 
class='postAudiowithPayPal'>Post audio with PayPal</a>";

}
echo"</div><br>";
//This is my second parallax image that doesn't cause difficulty
echo"<div class='pimg2'><span class='border'></span></div>";

这是来自我的style.css文件。我不确定是否需要设置我为链接指定的Links类的样式。

.pimg1{
background-image:url('pimg1.jpg');
min-height:100%;
height:600px;
}

.pimg2{
background-image:url('pimg2.jpg');
min-height:100%;
height:500px;
}
.pimg3{
background-image:url('pimg3.jpg');
min-height:100%;
height:500px;
}

@media(max-width:568px){
.pimg1, .pimg2, .pimg3{
    background-attachment: scroll;
}
}

.logo{
height: 100%;
width: 100%;
background-image:url('SpiritualAutomaton2.png');
position: center;
background-repeat: no-repeat;
position: absolute;
top:50%;
margin-top:-50px;
margin-left:130px;


}
.Links{
      ?
}

1 个答案:

答案 0 :(得分:1)

问题是你的.logo身高。尝试使用与您用作背景的图像相同的大小。您可以在此图像中看到并将鼠标放在最左侧的输入上,然后向右移动,徽标div将阻挡下面的元素。另一种选择是在pointer-events:none;元素上设置.logo,但在这种情况下这有点hacky。

enter image description here