Jump to content
mickeymouse

Dropdown Box Width

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

 

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...