CSS Layout How to - Vertically Align Elements








Question

We would like to know how to vertically Align Elements.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.submitform {<!--from ww  w  .  j a va2 s .  com-->
  width: 300px;
  height: 500px;
  vertical-align: bottom;
  padding: 0 10px;
  outline: 1px solid black;
}

input, a {
  font-family: Arial, sans-serif;
  font-size: 1.00em;
  display: inline;
  line-height: 50px;
}
</style>
</head>
<body>
  <div class="submitform">
    <input type="submit" value="Initiate Request" /> 
    <a href="">Cancel</a>
    <a href="">Cancel</a>
  </div>
</body>
</html>

The code above is rendered as follows: