HTML Form How to - Float input right








Question

We would like to know how to float input right.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
input {<!--   www  .ja  v  a 2 s  .  c o m-->
  float: right;
}
</style>
</head>
<body>
  <div>
    <input type="text" class="user" /> <input type="text" class="password" />
    <input type="button" value="I'm on the left" />
  </div>
</body>
</html>

The code above is rendered as follows: