I have written the following code snippet:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Main.aspx.cs" Inherits="Main" %>
<!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></title>
<link rel="stylesheet" type="text/css" href="Styles/TomsStyleSheet.css" />
</head>
<body>
<form id="form1" runat="server">
<div class="centerBlock">
<asp:GridView ID="GridView1" runat="server" CcsClass="center">
</asp:GridView>
</div>
<br />
<div class="centerBlock">
<asp:Label ID="Label1" runat="server" Text="Enter Directory Path: "></asp:Label>
<asp:TextBox ID="TextBox" Width="200px" runat="server"></asp:TextBox>
<br />
<br />
<asp:Button ID="checksumBtn" runat="server" Text="Calculate Checksum" OnClick="CalculateChecksum" />
<br />
<asp:Label ID="errorMsg" runat="server" Text="" CssClass="error"></asp:Label>
</div>
</form>
</body>
</html>
The associated CSS file contains this style snippet:
.centerBlock
{
margin-left:auto;
margin-right:auto;
width:50%;
}
Currently, I am attempting to center align the content both vertically and horizontally on the page.
Despite trying different methods such as inline styles and referencing the stylesheet, I cannot get the content to center properly. It is currently left-aligned instead of centered. My browser of choice is IE 7.