Skip to content

CSS Form Design


HTML CODE:

<!DOCTYPE html>
<html>
<head>
    <title>page</title>
    <link rel="stylesheet" type="text/css" href="form.css">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css">
</head>
<body>

    <div class="contact-title">
        <h1>Say Hello</h1>
        <h2>We are always ready to serve you!</h2>
    </div>

    <div class="contact-form">
        <form id="contact-form" method="post" action="">
            <input type="text" name="name" class="form-control"
            placeholder="Your Name" required><br>s

            <input type="email" name="email" class="form-control"
            placeholder="Your Email" required><br>

            <textarea name="message" class="form-control"
            rows="4" placeholder="Message" required></textarea><br>

            <input type="submit" class="form-control submit" value="SEND MESSAGE">
        </form>
    </div>

</body>
</html>

CSS CODE:

body{
    padding:0;
    margin: 0;
    text-align: center;
    background: linear-gradient(rgba(0, 0, 150, 0.5),rgba(0, 0, 50, 0.5)),url(https://images.pexels.com/photos/314380/pexels-photo-314380.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940);
    background-size: cover;
    background-repeat: no-repeat;
    font-family: sans-serif;
}
.contact-title{
    margin-top: 100px;
    color: #fff;
    text-transform: uppercase;
    transition: all 4s ease-in-out;
}
.contact-title h1{
    font-size: 32px;
    line-height: 10px;
}
.contact-title h2{
    font-size: 16px;
}
form{
    margin-top: 50px;
    transition: all 4 ease-in-out
}
.form-control{
    width: 600px;
    background: transparent;
    border: none;
    outline: none;
    border-bottom: 1px solid gray;
    color: #fff;
    font-size: 18px;
    margin-bottom: 16px;
}
input{
    height: 45px;
}
form .submit{
    background:#ff5722;
    border-color: transparent;
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 2px;
    margin-top: 20px
}
form .submit:hover{
    background: #f44336;
    cursor: pointer;
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: