mickeymouse 0 Posted February 16, 2019 Report Share Posted February 16, 2019 How do we define the width for a Dropdown Box? My code is: print("<select name='title'> <option style='color:maroon; font-size:bold' name='title'>$title</option>"); while ($row = mysql_fetch_row($Results)) {print("<option value=$row[1]>$row[1]</option>");} print("</select>");. All of this works fine except I don't know where to define the width and can't find it in the W3S HRML documentation. Thank you Quote Link to post Share on other sites
dsonesuk 913 Posted February 16, 2019 Report Share Posted February 16, 2019 You style the select elements and the option should be identical to that width. 1 Quote Link to post Share on other sites
ishan_shah 2 Posted May 10, 2019 Report Share Posted May 10, 2019 (edited) print("<select name='title' class='dropdown'> <option style='color:maroon; font-size:bold' name='title'>$title</option>"); while ($row = mysql_fetch_row($Results)) {print("<option value=$row[1]>$row[1]</option>");} print("</select>"); In external CSS file: .dropdown{ width:150px; } Edited May 10, 2019 by ishan_shah Quote Link to post Share on other sites
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.