2014-01-30 70 views
4
<li><span>Test:</span> 
<asp:Label style="float:right;padding-right:5px" 
      runat="server" 
      ID="lblTest"> 
</asp:Label></li> 

我有一個跨度和標籤(我知道它也呈現爲跨度),不知何故靜態跨度的文字是好的,但標籤的文本中Li元素倒下....直到底部。 我曾嘗試垂直對齊和文本對齊,頂:0,但沒有運氣讓他們在一條直線上標籤掉下來在列表標籤​​

回答

1
<li> 
    <span>Test:</span> 
    <asp:Label style="display:inline-block;" runat="server" ID="lblTest">hi</asp:Label> 
</li> 

改變你的風格,以這樣的:

style="display:inline-block;" 

它顯示塊,如下

Output

Working Fiddle

+1

給予好評的小提琴解釋:) –

2

試試這個工作對我來說

<li> 
    <span>Test:</span> 
    <asp:Label style="padding-right:5px;display:inline;" runat="server" ID="lblTest"></asp:Label> 
</li>