Friday, January 9, 2009

Center Content in Content Place Holder

Review the MasterPage Code below to make your content stick to centre.

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage_MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<table cellpadding="0" cellspacing="0" border="1" width="90%">
<tr>
<td style="background-color: Black; width: 20%">
</td>
<td style="width: 80%">
<div style="text-align: center;">
<asp:ContentPlaceHolder ID="UserContentPlaceHolder" runat="server">
</asp:ContentPlaceHolder>
</div>
</td>
<td style="background-color: Black; width: 20%"></td>
</tr>
</table>
</form>
</body>
</html>

No comments:

Post a Comment