Question

<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

Was it helpful?

Solution 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

OTHER TIPS

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>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top