Reputation: 5866
I have dropdownlist and text doesnt display on the same level. text is located upper and dropdownlist is located on lower.
here is my code
<div style="display:inline;float:left">Ödeme Kalemi:</div>
<div style="display:inline;float:left">
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>test</asp:ListItem>
<asp:ListItem>test2</asp:ListItem>
</asp:DropDownList>
</div>
<div style="clear:both"></div>
and here is the screenshot
Please help me fix this. I need to align them horizontally.
Upvotes: 0
Views: 971
Reputation: 62260
You can use the following css to display dropdownlist next to label.
<style type="text/css">
.row { clear: both; overflow: hidden; padding: 5px 0; width: 100%; }
.row label { float: left; text-align: right;
margin-right: 10px; width: 150px; }
.row .value { float: left; text-align: left; }
</style>
<div class="row">
<label>Ödeme Kalemi:</label>
<div class="value">
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>test</asp:ListItem>
<asp:ListItem>test2</asp:ListItem>
</asp:DropDownList>
</div>
</div>
Upvotes: 1