Anchoring a user control at the bottom of ASP.NET 4.0 content

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Clifford Robins
    New Member
    • Nov 2010
    • 2

    #1

    Anchoring a user control at the bottom of ASP.NET 4.0 content

    I'm using the ASP.NET 4.0 ASP.NET application. It comes wired up for menu, login, roles, etc. This question is about placing a user control (which just contains a label with Copyright info, always at the bottom of the page. It found the Site.css entry to make the border it puts around the content always the same size - so it's consistent on every page, but I've not found how to make the user control stick to the bottom of the page. Right now I use the "footer" class which auto centers the content in the user control, but nothing to make it appear at the bottom of the page, without putting a bunch of <br> tags (a different number of them for each page, to keep the user control at the bottom. I've currently putting the user control inside <div class="footer"> which picks up the centering from the Site.css.

    Any suggestions would be welcome.
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    In the CSS "footer" class, set the position to "absolute" and then set the bottom attribute to 0.

    For example:
    Code:
    .footer{
      position:absolute;
      bottom:0;
    }
    -Frinny

    Comment

    Working...