Tab seems to be wrongly positioned

HTML, CSS and anything else that deals with client side capabilities.

Moderator: General Moderators

Post Reply
drayarms
Forum Contributor
Posts: 134
Joined: Fri Dec 31, 2010 5:11 pm

Tab seems to be wrongly positioned

Post by drayarms »

Below is the code for a form. One of the form elements, the year pull down menu, appears below the paragraph, which contains the other two elements in the same paragraph (date of birth). My idea was tho make all three pull down menus for the date of birth paragraph to appear on the same line, hence i included these items in tab tags, but for some strange reason, the year pull down menu, would not stay on that line. I have tried to give the div containing the form, an unlimited width to ensure that the width of the div wasn't the culprit but still, nothing changes. What could be the problem?


Code: Select all

<form id="complete_profile_form" action= "profile_input.php">


							


							<tab>Gender:
							<select name= "gender">
								<option value= "man">Man</option>
								<option value= "woman">Woman</option>
								<option value= "both">Both</option>
							<select>  </tab> 




							<p><tab> Date of Birth: <?php //Make the month pull down menu.
							//Array to store months. 
							$months = array (1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); 
							print '<select name= "month">';
							foreach ($months as $key => $value) {
							    print "\n<option value=\"$key\">$value</option>";
							}
							print '</select>'; ?> </tab> 
 

							<tab>  <?php //Make the day pull down menu
							print '<select name= "day">';
							for ($day = 1; $day <= 31; $day++) {
							    print "\n<option value=\"$day\">$day</option>";
							}
							print '</select>'; ?> </tab>

							<tab><?php //Make the year pull down menu 
							print '<select name= "year">';
							$start_year = date('Y');
							for ($y = ($start_year - 18); $y >= 1900; $y--) {
							    print "\n<option value=\"$y\">$y</option>";
							}
							print '</select>'; ?> </tab> </p>


							<p> Zip: <input name="zip" size="5"> </p>

							
							<p> <input type ="submit" input name="submit" value="Search!"/> </p>



						


						</form>
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Tab seems to be wrongly positioned

Post by califdon »

As far as I know, there is no HTML element <tab>. You can use <div> block elements or you can use a <table>, although the latter is shunned by many web designers. Ref.: http://htmltab.kb-creative.net/
Post Reply