Page 1 of 1

[solved] How to center site

Posted: Sun May 09, 2010 4:16 am
by Bo Jensen
I am new to CMSMS so for give me a rather simple question. I started by building from the ncleanblue theme, which is a wall to wall layout, but I want a say 60% size site and background color for the rest. Works the below settings,  but it is left and not centered, how can I center it ? Obviously easy, but I can not make it work. Any pointers more than welcome..

div#pagewrapper {
/* min max width, IE wont understand these, so we will use java script magic in the */
max-width: 80em;
min-width: 80em;
/* now that width is set this centers wrapper */
/*margin: 0 auto;*/
background: #fff url(uploads/sulumtheme/bg__full.png) repeat-x scroll left top;
color: black;
}

/* Mask helper  for browsers ZOOM, Rezise and Decrease */
#ncleanblue {
/* set to width of viewport */
width: 60%;
/* you can set your own image and background color here */
background: #fff url(uploads/sulumtheme/bg__full.png) repeat-x scroll left top;
}

Re: How to center site

Posted: Sun May 09, 2010 5:50 am
by RonnyK
Change the
/*margin: 0 auto; */
to
margin: 0 auto;
in your div#pagewrapper.

Ronny

Re: How to center site

Posted: Sun May 09, 2010 6:54 am
by Bo Jensen
Thanks for your reply, but it already tried this and it is still left. As said my css style is otherwise the same as ncleanblue. Can you guide me to some relevant documentation, I obviously need to learn more.

Re: How to center site

Posted: Sun May 09, 2010 7:12 am
by RonnyK
Do you have a link?

Ronny

Re: How to center site

Posted: Sun May 09, 2010 12:16 pm
by Bo Jensen
Yes, but it is not published yet, so you need a password to see it. I can email it to you, if I may ?
Thanks Bo

Re: How to center site

Posted: Sun May 09, 2010 4:18 pm
by RonnyK
PM is fine.

Ronny

Re: How to center site

Posted: Sun May 09, 2010 8:28 pm
by Bo Jensen
I figured out a solution by adding :

#html, body {
  top: 0px;
  right: 0px;
  bottom: 0px;
  left: 0px;
  width:980px;
  height: 100%;
  margin: auto;
}


Why this worked and other didn't I am unsure, but it works so I am good :-) Thanks for your time.

Re: [solved] How to center site

Posted: Sun May 09, 2010 10:23 pm
by Dr.CSS
Your biggest problem may have been you were setting #ncleanblue to a set width and it is meant to not have any width and it is wrapped around #pagewrapper and it has it's width set to 960px in another style sheet...

So most likely 60% is smaller than 80em, take out any width setting to #ncleanblue, remove the preset width for pagewrapper in the ncleanbluecore style sheet or remove the class of core-wrap-960 from it...

Setting body/html to a fixed width is not a good idea...

Re: [solved] How to center site

Posted: Mon May 10, 2010 6:36 pm
by Bo Jensen
You were correct, I did what you said and it worked. Thank you Dr. CSS.  I have now build a nice looking website, without any deep knowledge about CMS, html or CSS,  which says a lot about CMSMS.