How do I format label text? RRS feed

  • Question

  • I have a label that displays text, How can I format the text to be small? I want the text to be smaller.

    The label text looks like this Date cannot be before 5/1/2019.

    Here is the line of code.

    <asp:Label ID="HearingEarliestDateLabel" runat="server" CssClass="ControlNote" Text="Date cannot be before *earliest*."></asp:Label>

    • Moved by CoolDadTx Thursday, October 17, 2019 2:14 PM ASP.NET related
    Wednesday, October 16, 2019 8:34 PM

All replies

  • Hello,

    Make sure the style ControlNote is present. 

    A way to see if they style has an issue is check with the browser developer tools.

    You could try a inline style to see if that works too. 

    <asp:Label ID="HearingEarliestDateLabel" 
    	style="font-size: 8px;" 
    	Text="Date cannot be before *earliest*."></asp:Label>

    If that works then try placing the CSS into a style (as you have now).

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    profile for Karen Payne on Stack Exchange

    Wednesday, October 16, 2019 11:01 PM
  • Please post questions related to web development in the ASP.NET forums.

    Michael Taylor http://www.michaeltaylorp3.net

    Thursday, October 17, 2019 2:13 PM