Frage

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

I have a span and a label(I am aware its also rendered as span), somehow the static span's text is fine but the label's text falls down in the Li element....down to the bottom. I have tried vertical align and text align, top:0, but no luck to have them in a straight line

War es hilfreich?

Lösung 2

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

Change your style to this:

style="display:inline-block;"

It displays the block as below

Output

Working Fiddle

Andere Tipps

Try this it works for me

<li>
    <span>Test:</span>
    <asp:Label style="padding-right:5px;display:inline;" runat="server" ID="lblTest"></asp:Label>
</li>
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top