homepage Welcome to WebmasterWorld Guest from 50.19.74.67
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Select list widths
Orangutang




msg:4266444
 3:29 pm on Feb 13, 2011 (gmt 0)

Hi,

I'm trying to specify a fixed width for the initial select list display field irrespective of the lengths of the option values it contains.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<td align='left' width='150'>
<select name=testwidth>
<option value='a'>Short</option>
<option value='b'>Very Long</option>
</select>
</td>

The option value length is specified earlier on in the application with maxlength on the input to ensure its width is no longer than the space available with width='150'.

The select list above will be the width of Very Long and the width of 150 is more than that.

My question is how can I control the width of the display irrespective of how long Very Long is.

A prefect example is yahoo email, inbox displays your emails and you've got buttons to delete and spam and select lists for mark as and move to.

The select lists mark as and move to have an initial select list display field which is shorter than the lengths of the option values it contains.

mark as has Mark as the text display with a width of about 50px for the <td> but when you click it the first option is Mark as Unread which is clearly longer than Mark.

How do they do that then?
Thanks for any help in advance.

 

incrediBILL




msg:4266535
 6:51 pm on Feb 13, 2011 (gmt 0)

If I understand the question correctly, simply specify the maximum width of the select list, as the width of the table cell won't control the width of the selection list.

example:
<select style="position: relative; width: 100px">

Orangutang




msg:4266733
 9:28 am on Feb 14, 2011 (gmt 0)

Hi incrediBILL,

Perfect, exactly what I was after. Thanks.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved