title: ASP.net - Center Align Panel?
body: <p>I need to center align a panel. I use the following:</p>
  
  <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestDefault.aspx.cs" Inherits="tregware.TestDefault" %&gt;
  
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
  &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form id="form1" runat="server"&gt;
  &lt;asp:Panel ID="Root" runat="server" BackColor="Red"  HorizontalAlign="Center" Style="left: 0px; top: 0px; width: 100%; height: 100%; position: absolute; z-index: 0;"&gt;
  
  
  &lt;asp:Panel ID="Body" runat="server" BackColor="Blue" 
      Style="left: 0px; top: 24px;width: 800px; height: 100%; position: absolute; z-index: 0;" 
      HorizontalAlign="Center"&gt;
  &lt;/asp:Panel&gt;
  
  &lt;/asp:Panel&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>However the panel ("Body") will not center. How would I do so?</p>