Skip to content

Instantly share code, notes, and snippets.

@pchatterjee
Last active February 14, 2023 16:44
Show Gist options
  • Select an option

  • Save pchatterjee/d0add69d6a363adfcadf6947148224f5 to your computer and use it in GitHub Desktop.

Select an option

Save pchatterjee/d0add69d6a363adfcadf6947148224f5 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<title>HTML5 Form Example </title>
<style>
body {
margin: 20px auto;
font-family: 'Lato';
font-weight: 400;
font-size: 1.25rem;
}
form, p {
margin: 20px;
}
p.note {
font-size: 1rem;
color: red;
}
input {
border-radius: 5px;
border: 1px solid #ccc;
margin-left: 20px;
padding: 8px;
margin-bottom: 20px;
font-family: sans-serif;;
font-size: 16px;
width: 200px;
}
label {
font-family: sans-serif;
font-size: 16px;
width: 146px;
display: inline-block;
}
input[type=submit] {
background-color: #214252;
color: white;
width: 120px;
padding: 8px 20px;
font-size: 18px;
border: none;
border-radius: 4px;
cursor: pointer;
float: left;
margin-left: -4px;
}
input[type=submit]:hover {
background-color: #92817a;
}
</style>
</title>
</head>
<body>
<form action="" method="post" >
<label for="name">name: </label>
<input type="text" id="name" name="name" placeholder="Monty">
<br>
<label for="name">email: </label>
<input type="email" id="email" name="email" placeholder="joe@email.com">
<br>
<label for="name">age: </label>
<input type="number" id="age" name="age" min="16" max="99" placeholder="20">
<br>
<label for="name">favourite website: </label>
<input type="url" id="website" name="website" placeholder="https://youtube.com">
<br/>
<input type="submit" value="submit">
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment