Thursday, December 2, 2021

Form on Hero Image

 Form on Hero Image

<!DOCTYPE html>
<html>

<head>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="STYLESHEET" type="text/css" href="web.css">
    <title>web design</title>
</head>

<body>
    <h2>Form on Hero Image</h2>
    <div class="bg-image">
        <form class="container">
            <h1>Login</h1>
            <label for="email">Email</label>
            <input type="text" name="email" placeholder="Email" required>
            <label for="psw">Password</label>
            <input type="password" name="psw" placeholder="Password" required>
            <button type="submit" class="login"> Login</button>
        </form>
        <p>This example creates a form on a responsive image. Try to resize the browser window to see how it always will
            cover the whole width of the screen, and that it scales nicely on all screen sizes.</p>
    </div>
</body>

</html>

 

CSS Form on Hero Image Style

 body{

    height:100%;

    font-family: Arial, Helvetica, sans-serif;

}

*{

    box-sizing: border-box;

}

.bg-image{

    background-image:url(hero.jpg) ;

    background-repeat: no-repeat;

    background-position: center;

    background-size: cover;

    position: relative;

    min-height: 380px;

}

.container{

    position: absolute;

    right:0px;

    margin: 20px;

    max-width: 300px;

    padding: 16px;

    background-color: white;

}

input[type=text],input[type=password]{

    width:100%;

    padding:15px;

    margin:5px 0 22px 0;

    border: none;

    background-color: #f1f1f1;

}

input[type=text]:focus, input[type=password]:focus{

    background-color: #ddd;

    color: #fff;

}

.login{

    background-color: #04AA6D;

    border: none;

    color:#fff;

    padding: 16px 20px;

    width: 100%;

    cursor: pointer;

    opacity: 0.9;

}

.login:hover{

    opacity:0.1 ;

}

No comments:

Post a Comment

JavaScript Animated

  JavaScript Animated <!DOCTYPE html> <html> <style> #myContainer {   width: 400px;   height: 400px;   position: relative;...