...">

Label falls in list tag

<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 know that it also displays as a span), somehow the static text of the range is fine, but the label text falls in the Li ... element down. I tried vertical alignment and text alignment, top: 0, but it will not be possible to keep them in a straight line.

+4
source share
2 answers
<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 below.

Output

+1
source

Try it, it works for me

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

Source: https://habr.com/ru/post/1524519/


All Articles