Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

min-width and select lists

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
what am I doing wrong, I don't seem to be able to get min-width to work with select lists
Code:
<select id="lender" name="lender" style="min-width:200px;">
<option value="Other">Other</option></select>
this stays the width of its contents.

is there an issue with select lists?

thanks 1DMF

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
AFAIK the behaviour of the select element is largely dependant on the OS/browser, so it will be hard to make advanced css2 attributes to work as expected. Are you having trouble with this property being recognized across all the browsers?
 
well it's not really a browser issue persae, it's an outlook issue I guess, basicaly to get the form fields/labels to line up once the form is emailed I would like to force a minimum width on the select list.

Small selections make the form go out of line due to the floats, it's not a biggie I can force a full width I guess to encompass the possible maximum selection.

though i have now applied a clear:both to the next element so hopefully will force the next label down to where I want it, just need to test it to see if thats solved my problem.

cheers 1DMF

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
To ensure the minimum width of a select box in a mail application, I would suggest adding the generic 'select one' option at the top which will be long enough to ensure the appropriate size of the box.

That said, I suggest you don't rely on elements being big enough to get pushed down. That is a really good option with e.g. thumbnails, where smaller window will have only three items across and bigger will have more but if you're trying to line up a form, I suggest you use a more definitive line breaker.
 
what would you concider a definitive line breaker <hr /> ? or an empty div with forced dimensions?

the clear:both does however do the job, but I hate having to apply 'out-side-the-norm' specific CSS to elements, I guess it's only the template for merging the submitted details to email so not a biggie, but still I feel dirty applying sneaky inline styles to the email template, oh dear, i'm starting to become anally semantic , look what you've done to me [tongue]

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Also watch out as *some* mail clients will completely die with some CSS.
When doing HTML email stuff I tend to revert back to the nasty old school ways.

There are also some gotchas as to where you put your CSS in HTML emails. I believe that Hotmail for example will ignore any CSS that's put in the <head> portion of an HTML email (though this may have changed since I've not done one for a long time).

<honk>*:O)</honk>

Earl & Thompson Marketing - Marketing Agency Services in Gloucestershire
 
very good point Foamy, Hotmail got me going round in circles a year back till I found that out, stupid MS Hotmail!

This project is an internal one for a members area, need the facility for members to complete forms and submit them online and our admin team get them in their email box , we all have outlook 2003 so I only have the one common denominator to work to thankfully :)

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top