Link to home
Start Free TrialLog in
Avatar of nyk001
nyk001

asked on

CSS Site aligned center - Not centered in FireFox (DotNetNuke Site)

Looking a site that was done using DotNetNuke (DNN).

I've been asked to align the whole to the center. So I simply put the whole site in a DIV tag and added some CSS.

It displays fine in IE7, however, in FireFox v3.0.6 (on windows) the centering doesn't appear to be even. The left side gap seems larger than the other opposite side.

Here is a link to a development copy of the site: http://dnn.nykglobal.com/rylandgray

I have also added the CSS code used to center the site.

Any help would be appreciated.

I didn't produce this skin/template (its tables :P ) but will try to help out with any further questions needed to help resolve this.

Many thanks! :D
/* CSS */
body {
text-align:center; /* for IE */
}
 
div#ctrwrapper {
text-align:left; /* reset text alignment */
width:680px; /* or a percentage, or whatever */
margin:0 auto; /* for the rest */
}

Open in new window

Avatar of erw13n
erw13n
Flag of Indonesia image

if it was a tables, is simple :

<table width="100%" align="center" valign="top">
<tr>
<td>

[Your main body with fixed width]
<table class="pagemaster" .....>
</table>

</td>
</tr>
</table>
SOLUTION
Avatar of knonie
knonie
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you just want to use <div> :
body {
margin:0px; padding:0px; 
]text-align:center; /* IE hack */
}

Open in new window

Everything described in this link has been followed in the site.

Problen was just because of the wrong width value in wrapper div.

:-)
Oh OK.  I checked and did not find the 800px. Or the browsers are given it an auto width?

The <div id="ctrwrapper"> has 680px and the tables are within.

Kronie kindly point me to the right direction.

MD
 
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nyk001
nyk001

ASKER

Thank you all for your help. I hope the point share was acceptable for everyone ;)
Glad it is working now. Would you mind sharing the compiled solution of the problem so that the whole team here can benefit from it?