My Technical Notes

Friday, 31 May 2013

Styling ComboBox in Dynamic Data

ASP.NET Dynamic unfortunately does not have a CSS class for the ComboBox. I found this tricky because styles that were being inherited was changing the look of the ComboBox I had placed in a table. Therefore I needed to override some inherited styles and also make the ComboBox look like any other Dynamic Data control.

Here is my CSS code for the class DDComboBox:

.DDComboBox input[type=text]
    /* can be merged with .DDTextBox */
    color: #666;
    font: .95em Tahoma, Arial, Sans-Serif;
    border: solid 1px #dcdcdc;
    background-color: #FEFEFE;

.DDComboBox table td
    padding: 0px;
    border: none;

.DDComboBox table td,
.DDComboBox table tbody
    vertical-align: bottom;

No comments: