如何将登录按钮指向另一个页面?

时间:2014-12-29 07:44:07

标签: html css login registration

<!DOCTYPE html>
<html>

<head>

  <meta charset="UTF-8">

  <title>Welcome to Wave - Log In, Sign Up or Learn More</title>

    <style>
@import url(http://fonts.googleapis.com/css?family=Exo:100,200,400);
@import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro:700,400,300);

body{
    margin: 0;
    padding: 0;
    background: #fff;

    color: #fff;
    font-family: Arial;
    font-size: 12px;
}

.body{
    position: absolute;
    top: -20px;
    left: -20px;
    right: -40px;
    bottom: -40px;
    width: auto;
    height: auto;
    background-image: url(http://ginva.com/wp-content/uploads/2012/07/city-skyline-wallpapers-008.jpg);
    background-size: cover;
    -webkit-filter: blur(5px);
    z-index: 0;
}

.grad{
    position: absolute;
    top: -20px;
    left: -20px;
    right: -40px;
    bottom: -40px;
    width: auto;
    height: auto;
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0)), color-stop(100%,rgba(0,0,0,0.65))); /* Chrome,Safari4+ */
    z-index: 1;
    opacity: 0.7;
}

.header{
    position: absolute;
    top: calc(50% - 35px);
    left: calc(50% - 255px);
    z-index: 2;
}

.header div{
    float: left;
    color: #fff;
    font-family: 'Exo', sans-serif;
    font-size: 35px;
    font-weight: 200;
}

.header div span{
    color: #5379fa !important;
}

.login{
    position: absolute;
    top: calc(50% - 75px);
    left: calc(50% - 50px);
    height: 150px;
    width: 350px;
    padding: 10px;
    z-index: 2;
}

.login input[type=text]{
    width: 250px;
    height: 30px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 2px;
    color: #fff;
    font-family: 'Exo', sans-serif;
    font-size: 16px;
    font-weight: 400;
    padding: 4px;
}

.login input[type=password]{
    width: 250px;
    height: 30px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 2px;
    color: #fff;
    font-family: 'Exo', sans-serif;
    font-size: 16px;
    font-weight: 400;
    padding: 4px;
    margin-top: 10px;
}

.login input[type=button]{
    width: 260px;
    height: 35px;
    background: #fff;
    border: 1px solid #fff;
    cursor: pointer;
    border-radius: 2px;
    color: #a18d6c;
    font-family: 'Exo', sans-serif;
    font-size: 16px;
    font-weight: 400;
    padding: 6px;
    margin-top: 10px;
}

.login input[type=button]:hover{
    opacity: 0.8;
}

.login input[type=button]:active{
    opacity: 0.6;
}

.login input[type=text]:focus{
    outline: none;
    border: 1px solid rgba(255,255,255,0.9);
}

    enter code here

.login input[type=password]:focus{
    outline: none;
    border: 1px solid rgba(255,255,255,0.9);
}

.login input[type=button]:focus{
    outline: none;
}

::-webkit-input-placeholder{
   color: rgba(255,255,255,0.6);
}

::-moz-input-placeholder{
   color: rgba(255,255,255,0.6);
}
</style>

    <script src="js/prefixfree.min.js"></script>

</head>

<body>

  <div class="body"></div>
        <div class="grad"></div>
        <div class="header">
            <div>Welcome to<span><br>Wave</span></div>
        </div>
        <br>
        <div class="login">
                <input type="text" placeholder="username" name="user"><br>
                <input type="password" placeholder="password" name="password"><br>
                <input type="button" value="Login">
        </div>

  <script src='http://codepen.io/assets/libs/fullpage/jquery.js'></script>

    enter code here

</body>

</html>

如何将登录按钮指向另一个页面?我正在为我的班级(高中)做这个,需要帮助。人们需要登录什么。我已经填写了一份注册表。我真的很感激帮助。

4 个答案:

答案 0 :(得分:1)

只需添加&#34; onclick&#34;事件到你的按钮。实际上你应该为你的按钮添加一个ID,并将事件分解为一个单独的JS脚本,但这可以用于你的目的。

<input type="button" value="Login" onclick="location.href = 'otherpage.html';">

还可以将所有样式移动到style.css文件中,然后将其与

链接
<link rel="stylesheet" type="text/css" href="style.css">

这样你就不会堵塞你的HTML。

答案 1 :(得分:0)

<form action="other page link" method="post">   
<div class="login">
   <input type="text" placeholder="username" name="user"><br>
   <input type="password" placeholder="password" name="password"><br>
   <input type="submit" value="Login">
</div>
</form>

答案 2 :(得分:0)

试试这个

<div class="login"
    <form action="otherpage.html" method="post">
    <input type="text" placeholder="username" name="user"><br>
    <input type="password" placeholder="password" name="password"><br>
    <input type="submit" value="Login">
    </form>
</div>

我希望这对你有用。

答案 3 :(得分:0)

您应该将用户的登录信息发送到要处理的服务器端脚本,然后为该用户分配会话

从JavaScript检查和重定向的凭据不简单,专家用户可以轻松绕过此身份验证阶段。我的建议是创建一个HTML表单元素,然后将这些信息提交给服务器端和服务器,将用户重定向到另一个页面。

HTML表单:

<form action="address to server-side script" class="login" >
     <input type="text" placeholder="username" name="user"><br>
     <input type="password" placeholder="password" name="password"><br>
     <input type="submit" value="Login">
</form>
相关问题