2014-01-20 16 views
0

我在html中有一個註冊表單,我必須將標籤對齊到左側,輸入與右側對齊。 這是代碼:html - 在註冊表中對齊

<form method = "post" action = "registrazione2.php"> 
     <fieldset> 
     <p><p align="right" style="font-size: 15pt; color: #000000"> 
      <label>Nome:</label> 
      <input type="text" name="Nome" value ="<?php echo $nome; ?>" style="position: static;" size="30";/> 
     </p><br /> 
     <p><p align="right" style="font-size: 15pt; color: #000000"> 
      <label>Cognome:</label> 
      <input type="text" name="Cognome" value ="<?php echo $cognome; ?>" style="position: static;" size="30"; /> 
     </p><br /> 
     <p><p align="right" style="font-size: 15pt; color: #000000"> 
      <label>Età:</label> 
      <input type="text" name="Eta" value ="<?php echo $eta; ?>" style="position: static;" size="30";/> 
     </p><br /> 
     <p><p align="right" style="font-size: 15pt; color: #000000"> 
      <label>Sesso:</label> 
      <select name = "os" style="position: static;" > 
       <?php 
       if($sesso == "") 
        echo "<option selected = \"selected\">Selezionare sesso</option>"; 
       else?> 
       <option value="Uomo" <? if($sesso == "Uomo") echo "selected = \"selected\";"?>Uomo</option> 
       <option value="Donna" <? if($sesso == "Donna") echo "selected = \"selected\";"?>Donna</option> 
      </select> 
     </p> <br /> 
     <p><p align="right" style="font-size: 15pt; color: #000000"> 
      <label>Città:</label> 
      <input type="text" name="Citta" value ="<?php echo $citta; ?>"style="position: static;" size="30"; /> 
     </p><br /> 
     <p><p align="right" style="font-size: 15pt; color: #000000"> 
      <label>CAP:</label> 
      <input type="text" name="CAP" value ="<?php echo $cap; ?>" style="position: static;" size="30";/> 
     </p> <br /> 
     <p><p align="right" style="font-size: 15pt; color: #000000"> 
      <label>Via:</label> 
      <input type="text" name="Via" value ="<?php echo $via; ?>" style="position: static;" size="30";/> 
     </p><br /> 
     <p><p align="right" style="font-size: 15pt; color: #000000"> 
      <label>Numero civico:</label> 
      <input type="text" name="Civico" value ="<?php echo $civico; ?>" style="position: static;" size="30";/> 
     </p> <br /> 

     <p><p align="right" style="font-size: 15pt; color: #000000"> 
      <label>Recapito telef. :</label> 
      <input type="text" name="Telefono" value ="<?php echo $telefono; ?>" style="position: static;" size="30";/> 
     </p> <br /> 
     <p><p align="right" style="font-size: 15pt; color: #000000"> 
      <label>Indirizzo Mail:</label> 
      <input type="text" name="Mail" value ="<?php echo $mail; ?>" style="position: static;" size="30"; /> 
     </p> <br /> 
     <p> 
     <p align="right" style="font-size: 15pt; color: #000000"> 
      <label>Password:</label> 
      <input type="password" name="Password" style="position: static;" size="30";/> 
     </p> <br /> <br /> 
     </fieldset> 
     <input type = "reset" id="contact-submit" value = "AZZERA DATI" style="position: static;" /> 
<input type = "submit" id="contact-submit" value = "CONFERMA" style="position: static;" /> 

</form> 

與我對準標籤離開,但輸入的CSS規則上

回答

0

應用CSS如下的權利沒有對齊:

label{ 
    float:left; 
} 
input[type="text"]{ 
    float:right; 
} 
+0

謝謝很多! – Nicola

+0

請參閱更精確的樣式屬性的編輯答案。如果有幫助請接受答案。 –

+0

yesss,第一個答案我有提交和重置問題,現在沒關係!再次感謝 – Nicola