Answers for "how to make input and label align right"

0

how to make input and label align right

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
    <style>
      div {
        margin-bottom: 10px;
      }
      label {
        display: inline-block;
        width: 150px;
        text-align: right;
      }
    </style>
  </head>
  <body>
    <form action="/form/submit" method="post">
      <div>
        <label>Short</label>
        <input type="text" />
      </div>
      <div>
        <label>Simple label</label>
        <input type="text" />
      </div>
      <div>
        <label>Label having more text</label>
        <input type="text" />
      </div>
    </form>
  </body>
</html>
Posted by: Guest on May-14-2021

Code answers related to "how to make input and label align right"

Browse Popular Code Answers by Language