How to get rid of white space with the <br /> when the buttons visibility is off

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • firebirds98
    New Member
    • Feb 2008
    • 15

    How to get rid of white space with the <br /> when the buttons visibility is off

    I have 4 buttons on the start page. The first and last button are set to visible and the two middle buttons are set to false visibility.

    Code:
    <asp:Button ID="btnviewtracks" class="button_schedcontinue" Visible="true" runat="server" Text="View Tracks >>" /><br />
            
                 <asp:Button ID="btnRequestClass" class="button_schedcontinue" runat="server" Visible="False" Text="Update Status" AutoPostBack="True" /> <br />
                    
                 <asp:Button ID="btnviewclass" class="button_schedcontinue" Visible="false" runat="server" Text="View All Classes >>" /> <br />
            
                 <asp:Button ID="btninstructor" class="button_schedcontinue" Visible="true" runat="server" Text="Instructor Page >>" />

    My problem is that their is white space between the first and last button because of the <br / > that are after the two middle buttons that are invisible. Is there any other way of doing this without using a table?
  • DrBunchman
    Recognized Expert Contributor
    • Jan 2008
    • 979

    #2
    Hi firebirds98,

    You've posted your question in the ASP Forum which is for Classic ASP only - I've moved it for you but in future please post all ASP.NET questions in the .NET Forum.

    Why can't you just remove the break tags if you don't want them to affect your layout?

    Dr B

    Comment

    • balabaster
      Recognized Expert Contributor
      • Mar 2007
      • 798

      #3
      Originally posted by DrBunchman
      Hi firebirds98,

      You've posted your question in the ASP Forum which is for Classic ASP only - I've moved it for you but in future please post all ASP.NET questions in the .NET Forum.

      Why can't you just remove the break tags if you don't want them to affect your layout?

      Dr B
      Assuming that the visibility of your buttons is set in the codebehind, wrap the buttons in a span and rather than setting the visibility of your buttons to false, set the visibility of the span to false...and hence your <br />s will no longer be displayed.

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        If your buttons are hidden visibility:hidd en and you want the space they occupy removed as well, try display:none
        Edit: Nevermind, I see what was wrong now. Your issue was with the extra <br/>s that are still there. Just listen to balabaster then

        Comment

        Working...