0

Tenho o seguinte código em HTML:

First Name:<input type="text"  placeholder="First name" name="first_name" required> <br>
Last Name:<input type="text" name="last_name"  placeholder="Last Name" required> <br>
Account Number:<input type="text" name="number"  placeholder="account number" onkeypress="return justNumber(event)" required> <br>
Security Number:<input type="text" name="security_number"  placeholder="security number" onkeypress="return justNumber(event)" required>

Tentei alinhar usando text-align:center; e não deu certo - veja a foto pf aqui: https://i.sstatic.net/mMCDl.jpg

1 Resposta 1

0

Possível solução:

.form-container span.input-label{
  display: inline-block;
  width: 120px; /* width a ajustar */
  text-align: right;
  padding-right: 10px;
}
<div class="form-container">
  <span class="input-label">First Name:</span><input type="text"  placeholder="First name" name="first_name" required> <br>
  <span class="input-label">Last Name:</span><input type="text" name="last_name"  placeholder="Last Name" required> <br>
  <span class="input-label">Account Number:</span><input type="text" name="number"  placeholder="account number" onkeypress="return justNumber(event)" required> <br>
  <span class="input-label">Security Number:</span><input type="text" name="security_number"  placeholder="security number" onkeypress="return justNumber(event)" required>
</div>

Você deve fazer log-in para responder a esta pergunta.

Esta não é a resposta que você está procurando? Pesquise outras perguntas com a tag .