HTML Form How to - Create Styled Login Form with shadow








Question

We would like to know how to create Styled Login Form with shadow.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
body {<!--from  w ww .  ja va  2s .  c  o m-->
  background-color: #858585;
}

form {
  padding: 40px;
  background-color: white;
  margin: auto;
  margin-top: 100px;
  width: 400px;
  font-size: 18px;
  border-radius: 10px;
  box-shadow: 0px 0px 8px 5px rgba(0, 0, 0, .4);
  min-height: 100px;
}

input[type=email], input[type=submit] {
  display: block;
  font-size: 18px;
  margin-bottom: 15px;
}

input[type=email] {
  width: 400px;
  padding: 4px;
  float: right;
}

input[type=submit] {
  padding: 8px;
  width: 100px;
  float: right;
}
</style>
</head>
<body>
  <form>
    <input type="email" placeholder="email address"> 
    <input type="submit" value="Sign In">
  </form>
</body>
</html>

The code above is rendered as follows: