html - Trying to align input field with labels -


i want align input fields shown below, keep using <label> in correct way.

enter image description here

the code below:

<form action="add.php" method="post" enctype="multipart/form-data">     <label for="refno">field1 name (long)</label>     <input id="refno" type="text" name="refno" value="" /><br>     <label for="name">field2 name</label>     <input id="name" type="text" name="name" value="" /><br>         <input type="submit" value=":: add  ::" name="addbtn" /> </form> 

i thinking separate <label> tags in <div> , input fields in , floating manipulation make intended alignment, correct way?

how

form > label {    min-width: 185px;    display: inline-block;  }
<form action="add.php" method="post" enctype="multipart/form-data">    <label for="refno">field1 name (long)</label>    <input id="refno" type="text" name="refno" value="" /><br>    <label for="name">field2 name</label>    <input id="name" type="text" name="name" value="" /><br>        <input type="submit" value=":: add  ::" name="addbtn" />  </form>


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -