rv20 Posted May 22, 2009 Share Posted May 22, 2009 Trying to align a label or just text) inforont of two textobxes but the textboxes are not aligned with each other, any ideas, <form method='post' action="login.php"> <label for "uname">Name:</label> <input type="text" name="uname" size="16" /> <label for "pword">Password:</label> <input type="text" name="pword" size="16" /> <input type="submit" name="submit" value="login" /> </form> Quote Link to comment https://forums.phpfreaks.com/topic/159298-align-two-text-input-fields/ Share on other sites More sharing options...
DarkSuperHero Posted May 23, 2009 Share Posted May 23, 2009 use some CSS :-) <form method='post' action="login.php"> <div style="width:300px;"> <label for="name" style="float:left;">Name:</label> <input type="text" name="uname" id="name" size="16" style="float:right;clear:right"/> <label for="pass" style="float:left;clear:left">Password:</label> <input type="text" name="pword" id="pass" size="16" style="float:right;clear:right"/> <input type="submit" name="submit" value="login" style="float:right;clear:both;"/> </div> </form> Also fixed some errors u had in your code... Try it out: http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_label to have the labels and the text fields closer together adjust the overall width of the div wrapping your elements... Quote Link to comment https://forums.phpfreaks.com/topic/159298-align-two-text-input-fields/#findComment-840449 Share on other sites More sharing options...
rv20 Posted May 23, 2009 Author Share Posted May 23, 2009 thanks a lot, been trying to get this for a while.. Quote Link to comment https://forums.phpfreaks.com/topic/159298-align-two-text-input-fields/#findComment-840630 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.