* {
--input-height: 3rem;
}
.contactform {
position: relative;
border-radius: 50px;
background-color: #f2f2f2;
padding: 5px;
z-index: 2;
display: block;
margin-left: auto;
margin-right: auto;
margin-bottom: auto;
margin-top: 1%;
width: 100%;
animation-name: gradient;
animation-duration: 3s;
animation-iteration-count: infinite;
}
.contactform:hover {
animation-name: gradient;
animation-duration: 15s;
animation-iteration-count: infinite;
}
.row:after {
content: "";
display: table;
clear: both;
}
.column {
float: center;
width: 50%;
margin-top: 6px;
padding: 20px;
display: block;
margin-left: auto;
margin-right: auto;
}
section {
height: 100vh;
width: 100vw;
display: grid;
place-content: center;
}
.input-container input {
height: var(--input-height);
width: 80vw;
font-size: 2rem;
}
.input-container {
position: relative;
display: grid;
place-items: center start;
margin-top: 6px;
margin-bottom: 16px;
width:50%;
}
.input-container label {
position: absolute;
left: 1rem;
font-size: 1.5rem;
color: rgb(90, 90, 90);
background-color: white;
transition-duration: 0.5s;
}
.input-container input:focus~label {
position: absolute;
font-size: 0.7rem;
top: -0.6rem;
padding: 0.2em;
left: 0.5rem;
color: rgb(0, 81, 255);
background-color: white;
transition-duration: 0.2s;
z-index: 2;
}
input[type=submit] {
background-color: #0563bb;
color: white;
padding: 12px 20px;
border: none;
cursor: pointer;
}
input[type=submit]:hover {
opacity: 0.9;
}
@media screen and (max-width: 600px) {
.column,
input[type=submit] {
width: auto;
margin-top: 0;
}
}
@keyframes shake {
10%,
90% {
transform: translate3d(-1px, 0, 0);
}
20%,
80% {
transform: translate3d(2px, 0, 0);
}
30%,
50%,
70% {
transform: translate3d(-4px, 0, 0);
}
40%,
60% {
transform: translate3d(4px, 0, 0);
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
</br></br>
<section id="contact">
<div class="container" data-aos="fade-up">
<div class="contactform">
<div style="text-align:center">
<div class="section-title">
<h2><br/>Get In Touch</h2>
</div>
<p>Feel Free To Reach Out To Me Through This Form! </p>
</div>
<div class="row">
<div class="column">
<form name="myform" action="thankyou.html" method="POST" novalidate>
<div class="input-container">
<input type="text" id="first name" name="firstname" required>
<label for="firstname">First Name</label>
</div>
<div class="input-container">
<input type="text" id="lastname" name="lastname" required>
<label for="lastname">Last Name</label>
</div>
<input type="submit" value="Submit">
</form>
</div>
</div>
</div>
</section>
</body>