mickeymouse Posted February 16, 2019 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 Link to comment Share on other sites More sharing options...
dsonesuk Posted February 16, 2019 Share Posted February 16, 2019 You style the select elements and the option should be identical to that width. 1 Link to comment Share on other sites More sharing options...
ishan_shah Posted May 10, 2019 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now