Browser Div Centering Problem

  • Thread starter Thread starter Sylv
  • Start date Start date
S

Sylv

Hello,

Below HTML code is my aspx page, when running on IE6.0+, my aspx page's DIV
is centered,

but when running on OPERA, FIREFOX or CHROME, it s placed on the left side
of these browsers, Not centered

What should I do ?

Thanks for your answer

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<style type="text/css">
.style1
{
width: 950px;
}
</style>
</head>
<body background="Resources/BackGround.jpg">
<form id="frmDefault" runat="server">
<div style="text-align: center">
<table cellpadding="0" cellspacing="0" class="style1">

....... bla bla bla

</table>
</div>
</form>
</body>
</html>
 
Ok now
Solved giving this;

<div style="margin-right:auto;margin-left:auto;width:950px;">

Or, do it the right way.. ;-)

In the page <head> put..

<style type="text/css">
#wrapper{
width: 950px;
margin: 0 auto;
}
</style>

<div id="wrapper">

John
 
Ok now
Solved giving this;

<div style="margin-right:auto;margin-left:auto;width:950px;">

Or, do it the right way.. ;-)

In the page <head> put..

<style type="text/css">
#wrapper{
width: 950px;
margin: 0 auto;
}
</style>

<div id="wrapper">

John
 
Back
Top