Caret displays inside of asp:Label control instead of beside it

Donald Symmons 3,066 Reputation points
2023-03-02T12:43:11.27+00:00

I am trying to have a caret display beside my asp:Label control so that when the caret is clicked, there will be a dropdown that will have logout, but the caret is displaying inside the label.

How can I have caret display beside the Label instead of inside?

<div class="collapse navbar-collapse" id="navbarSupportedContent">
                            <ul class="nav navbar-nav ml-auto">
                                <li class="dropdown" id="Li3" runat="server" style="padding: 5px; cursor: pointer;">
                                    <asp:Label class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false" ID="user" runat="server" Font-Size="10pt" Text="" ForeColor="#0b2436"></asp:Label>
                                    <ul class="dropdown-menu dropdown-menu-right" style="border: none; background-color: #fff; font-size: 9pt; border: 0.5px solid #e9ebeb;">
                                        <li class="dropdown" runat="server">
                                            <asp:LinkButton ID="LinkButton3" runat="server" Font-Size="11pt" ForeColor="red" BackColor="White" OnCommand="Logout_Command">
                                                <i class="fal fa-sign-out" aria-hidden="true" style="margin: 0 auto; font-size: 10pt; color: #0b2436;"></i> Logout
                                            </asp:LinkButton>
                                        </li>
                                    </ul>
                                </li>
                            </ul>
                        </div>

Developer technologies | .NET | Other
Developer technologies | ASP.NET | Other
0 comments No comments
{count} votes

Accepted answer
  1. Lan Huang-MSFT 30,191 Reputation points Microsoft External Staff
    2023-03-06T02:03:33.59+00:00

    Hi @Donald Symmons ,

    I tested your code. Is the caret that circle? You try the code below.

    <div class="collapse navbar-collapse" id="navbarSupportedContent">
                                <ul class="nav navbar-nav ml-auto">
                                    <li class="dropdown" id="Li3" runat="server" style="padding: 5px; cursor: pointer;">
                                        <asp:Label class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false" ID="user" runat="server" Font-Size="10pt" Text="" ForeColor="#0b2436">user</asp:Label>
                                        <ul class="dropdown" runat="server">
                                        <li class="dropdown-menu dropdown-menu-right" style="border: none; background-color: #fff; font-size: 9pt; border: 0.5px solid #e9ebeb;">
                                           
                                                <asp:LinkButton ID="LinkButton3" runat="server" Font-Size="11pt" ForeColor="red" BackColor="White" OnCommand="Logout_Command" >
                                                    <i class="fal fa-sign-out" aria-hidden="true" style="margin: 0 auto; font-size: 10pt; color: #0b2436;"></i> Logout
                                                </asp:LinkButton>
                                            </li>
                                        </ul>
                                    </li>
                                </ul>
                            </div>
    

    User's image

    Best regards,

    Lan Huang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.