center page - problems with firefox and opera

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
d_soare
New Member
New Member
Posts: 7
Joined: Sat Apr 05, 2008 7:57 pm

center page - problems with firefox and opera

Post by d_soare »

I have a problem with centering the page on the screen. In IE it works perfect, but in firefox and opera, if I try to center the page looks extremely ugly (it doesn't show the background on all pages).
I have a stylesheet "layout: left sidebar + 1 column", to make the firefox and opera look fine. the problem is that I cannot make these two see my pages centered. The code I am using is:


basic layout
*****************/
body {
  background-color: #7b1010; 
color: #000000;
  margin:1em;    /* gives some air for the pagewrapper */
}

/* center wrapper, min max width */
div#pagewrapper {
float: left;
  margin: 0 auto;      /* this centers wrapper */
  width: 800px;  /* IE wont understand these, so we will use javascript magick */
  background-color: #7b1010;
  color: black;
  background: url('images/cms/corp_bg.gif') repeat-y;
}


/*** header ***
we will hide text and replace it with a image
we need to assign a height for it so that the image wont cut off
*/
div#header {
  height: 115px;  /* adjust according your image size */
  background: #7b1010;       
}
/*****************
.


If I change float: center, everything goes wrong in firefox and opera.
I really want my page centered, because I made it 800*600 and it doesn't look ok on screen displaying a highresolution.

Can anybody help?
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm
Location: Comox Valley, BC

Re: center page - problems with firefox and opera

Post by Nullig »

Take the float: left; out of the pagewrapper div. You don't need to float it.

Nullig
d_soare
New Member
New Member
Posts: 7
Joined: Sat Apr 05, 2008 7:57 pm

Re: center page - problems with firefox and opera

Post by d_soare »

I did, it's the same as float: center.
The host server is down now, I hope it won't take too long and I will attach a print screen with float left, float center and no float. If it's not float, I can't imagine where is the problem.

Thanks.
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm
Location: Comox Valley, BC

Re: center page - problems with firefox and opera

Post by Nullig »

Can you post a link to the site, so we can see what's happening?

Nullig
d_soare
New Member
New Member
Posts: 7
Joined: Sat Apr 05, 2008 7:57 pm

Re: center page - problems with firefox and opera

Post by d_soare »

www.corporateimage.ro, but I'm afraid it's still down.

Thanks a lot!
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm
Location: Comox Valley, BC

Re: center page - problems with firefox and opera

Post by Nullig »

Well, changing your pagewrapper div to:

div#pagewrapper {
  margin: 0 auto;      /* this centers wrapper */
  width: 800px;  /* IE wont understand these, so we will use javascript magick */
  background-color: #7b1010;
  color: black;
  background: url('images/cms/corp_bg.gif') repeat-y;
}

centers it for me. Of course, you have some other issues there with your styling.

Nullig
d_soare
New Member
New Member
Posts: 7
Joined: Sat Apr 05, 2008 7:57 pm

Re: center page - problems with firefox and opera

Post by d_soare »

it centers it for me too, the problem is that centered in Firefox and Opera doesn't show the background, the text is highlighted in white, it just looks crazy, unfinished. When I float it to left, everything is just fine. But not all pages, some of them.
d_soare
New Member
New Member
Posts: 7
Joined: Sat Apr 05, 2008 7:57 pm

Re: center page - problems with firefox and opera

Post by d_soare »

my site is back now. I attached 2 print screens: no float and float left. The site should look like "float left", but centered  ;D
Attachments
no float.JPG
float left.JPG
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm
Location: Comox Valley, BC

Re: center page - problems with firefox and opera

Post by Nullig »

It looks like you have an extra closing div just before the content div, which is closing the pagewrapper.

Nullig
d_soare
New Member
New Member
Posts: 7
Joined: Sat Apr 05, 2008 7:57 pm

Re: center page - problems with firefox and opera

Post by d_soare »

Yes, I did. Stupid me  ;D. It looks just fine, now. Thanks a lot!
Post Reply

Return to “Layout and Design (CSS & HTML)”