Posted By: SlackmasterK | Jul 31st @ 3:16 PM
page 1 of 1
Comments: 2 | Views: 704
SlackmasterK
SlackmasterK
I write my OWN blogging engines

The following markup positions a table in the center of the page in IE.  In Firefox, the table is positioned as it would be without positioning styles; about 5px in from the left side.  Can anyone tell me why?

Note that I would normally move the styles to a .css file, but this is just a prototype.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!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>Blog rewrite prototype 1</title>
</head>
<body>
<form id="form1" runat="server">
<div style="background-image: url(images/fade_blue_white.jpg); background-repeat: repeat-y; width: 50px; position: absolute; left: 0px; top: 0px; z-index: 0; height: 100%;"></div>
<div style="background-image: url(images/fade_white_blue.jpg); background-repeat: repeat-y; width: 50px; position: absolute; right: 0px; top: 0px; z-index: 0; height: 100%;"></div>
<div style="width: 98%; text-align: center; top: 0px; position: absolute;">
<table style="padding: 0px; height: 100%; width: 740px; text-align: left; z-index:1; background-color: #ffffff;">
<tr>
<td>
<img src="images/banner1.jpg" originalAttribute="src" originalPath=""images/banner1.jpg"" originalAttribute="src" originalPath=""images/banner1.jpg"" originalAttribute="src" originalPath=""images/banner1.jpg"" alt="banner image" />
</td>
</tr>
<tr>
<td style="text-align: justify;">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut bibendum lectus vulputate(...)
<br />
<br />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>



Note that I didn't add the stuff below; it was the C9 editor:
<img src="images/banner1.jpg" originalAttribute="src" originalPath=""images/banner1.jpg"">

stevo_
stevo_
Casablanca != Manchester
generally to horizontally center you will do margin: 0 auto; on a block level element with a set width..

Legacy and perhaps ie in quirks mode would also say you set text-align: center on the parent element, and then text-align: left back on the element itself.. although personally I don't use that anymore, the margin should work fine.
page 1 of 1
Comments: 2 | Views: 704