I am using mvc4 with the Razor engine. Here's what I've tried:
<div class="editor-field">
@Html.DropDownListFor(model => model.NewSymbol.Category.Id, new SelectList(Model.MarketCategories, "Id","Name"), new { @class = "dropdown" })
</div>
CSS is:
.dropdown {
margin-top: 5px;
margin-bottom: 10px;
padding: 3px 2px;
width: 312px;
}
option {
width: 312px !important;
}
Unfortunately I get something that looks like:
I am trying to get the drop down to be at least the same width as the 'select' element. I don't mind if it's wider if the text expands past 312px, but this narrow drop down looks goofy.
Thanks for your help everyone.