i have the following piece of code for a dropdown in html, and I am attempting to center the vaues that the dropdown contains. I imagine ‘center’ would have to be used or align=”center” however wherever i put them it wont center. could anyone point out where the tag would go?
<form id="form1" name="form1" method="post" align="center" action="section_search_results.php">
<p>Select The <b>Section</b> You Wish To Search Below... </p>
<p><center>
<label for="section"></label>
<label for="section2"></label>
<select name="section" id="section2">
<option value="Functional">Functional</option>
<option value="Technical">Technical</option>
<option value="Commercial">Commercial</option>
<option value="Implementation">Implementation</option>
<option value="Innovation">Innovation</option></center>
</select>
Thanks
No. CSS 2 was published in 1998 and made those obsolete. (Technically CSS 1 obsoleted them, but CSS 2 came at a time when browser support was getting decent).
Apply the text-align property to the option elements.
Note that due to the way different browsers have implemented the rendering of select elements, this does not enjoy universal support amount commonly used browsers.
The W3C host a CSS tutorial if you need it.