Web Development Kodex

contact form

index.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Contact Form</title>
<meta name="robots" content="noindex, nofollow">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header>
<h1>Contact Form</h1>
</header>
<div class="wrapper">
<div class="container">
<form action="https://formspree.io/your@email.com" method="post">
<p>Name:
<br>
<input type="text" name="name" placeholder="your name">
</p>
<p>Email:
<br>
<input type="email" name="_replyto" placeholder="your@email.com" required>
<br>
<p>Message:
<br>
<textarea name="message" rows="10" cols="52" placeholder="your message"></textarea>
</p>
<input type="submit" value="Send">
</form>
</div>
<!-- .container-->
</div>
<!-- .wrapper-->
<footer>
<small><a href="https://opensource.org/licenses/MIT">MIT</a></small>
</footer>
</body>
</html>

styles.css

body {
background: #eeeeee;
font-size: 16px;
font-family: "Trebuchet MS", Helvetica, sans-serif;
margin: 0;
}
a {
color: crimson;
text-decoration: none;
}
a:hover {
color: red;
}
/* Layout
------------------------------------------*/
header,
.container,
footer {
margin: 0 auto;
width: 88%;
max-width: 1080px;
}
.wrapper {
padding: 1em 0;
background: #ffffff;
}
/* Layout
------------------------------------------*/
input[type="text"],
input[type="email"],
textarea {
font-size: 1em;
background: linear-gradient(#eeeeee, #ffffff);
border-top: 2px solid #cccccc;
border-left: 2px solid #cccccc;
border-bottom: 2px solid #eeeeee;
border-right: 2px solid #eeeeee;
padding: .5em;
margin-top: .5em;
}
input[type="submit"] {
font-size: 1em;
background: linear-gradient(#ffffff, #eeeeee);
outline: 0;
padding: .5em 1em;
border-radius: 15px;
text-shadow: 1px 1px 3px rgba(198, 198, 198, 0.9);
border: 2px solid #eeeeee;
margin-top: 1em;
}
input[type="submit"]:hover {
background: linear-gradient(#eeeeee, #ffffff);
cursor: pointer;
}