views:

1364

answers:

4

I have a Panel with the following:

<asp:Panel ID="Panel1" runat="server" Height="101px">
    Day
    <asp:DropDownList ID="DropDownList1" runat="server" Height="24px" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
    </asp:DropDownList>
    &nbsp;Hour
    <asp:DropDownList ID="DropDownList2" runat="server">
    </asp:DropDownList>
</asp:Panel>

The texts ("Day" and "Hour") seem to have a different vertical alignment with respect to the dropdownboxes

alt text

How do I fix this easily?

A: 

Have you tried adjusting the vertical alignment using the style attribute? http://www.w3schools.com/Css/pr%5Fpos%5Fvertical-align.asp

Sonny Boy
These are ASP.Net controls, I'm not sure how you can apply CSS styles on these.
Nikhil
@Nikhil: Add a `style="..."` attribute. You won't get Intellisense for it, but it will render correctly. Instead of inline styles though you'd be better to use the CssClass property and put the styles in a stylesheet.
devstuff
Tried `style` out, but even after trying different alignment options, I could not get it properly aligned.
Nikhil
A: 

It's really this simple:

<div>
    Day
    <asp:DropDownList ID="DropDownList1" runat="server">
    </asp:DropDownList>
    Hour
    <asp:DropDownList ID="DropDownList2" runat="server">
    </asp:DropDownList>
</div>
IrishChieftain
This is not working either.
Nikhil
A: 

Try forming your tags as or add some whitespace around them. It may be wrapping.

tsilb
+1  A: 

One solution I stumbled on to was to enclose the text and DropDownLists in a Table with a single row and have a separate cell for each text/dropbox. Works like a charm.

Nikhil
Why use a table when SEO-friendly markup is just as simple and free?
IrishChieftain
No! Please, no! Table-layout is so 1991.
Sonny Boy