jimfog Posted June 26, 2012 Share Posted June 26, 2012 I have a form-here is the code: <div id="formcontainer"> <form action="register_new.php" method="post"> <label>Name:</label><span class="asterisk">*</span><input name="name" type="text" size="40" /></br> <label>Phone:</label><span class="asterisk">*</span><input name="phone" type="text" size="40" /><br> <label>Username/e-mail:</label><span class="asterisk">*</span><input name="username/e-mail" type="text" size="40" /></br> <label>Password:</label><span class="asterisk">*</span><input name="password" type="text" size="40" /></br> <input name="submit" type="submit" /></form></div> I want to adjust its line height,the problem is that by doing so,in the css rule(formcontainer) every single element is affected.What I want-for example- is to increase the space between the input name="name" and the label phone but NOT between a label and an in input element. I want the labels with their corresponding inputs packed together and at the same time the label-input pairs separated each other(increased line height). I hope I did not confused you. Link to comment Share on other sites More sharing options...
eTianbun Posted June 26, 2012 Share Posted June 26, 2012 I dont realy get you tho! Do you mean: Group each input and its label together? If yes,use: <fieldset> to group each input and its label together, then apply margin-bottom to the <fieldset> tag. Link to comment Share on other sites More sharing options...
jimfog Posted June 27, 2012 Author Share Posted June 27, 2012 Yes fieldset will do the trick. Is this the way usually elements of a form are grouped? Link to comment Share on other sites More sharing options...
eTianbun Posted June 27, 2012 Share Posted June 27, 2012 YES! Link to comment Share on other sites More sharing options...
niche Posted June 27, 2012 Share Posted June 27, 2012 I had no reason tho know that, but I do know. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.