Jump to content

Dropdown Box Width


mickeymouse
 Share

Recommended Posts

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

  • 2 months later...
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 by ishan_shah
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...