View Full Version : Centering the page

02-22-2011, 11:49 PM

Please help me! I'm a beginner so bare with me.
I wan't that frame centered behind that Vimeo
vidget... I can't do it, but is it even doable this
way I'm trying to do it? Propably not, but how should
I do it then? I want it to follow the other stuff cente-
red when clicking ctrl +/-
I'm lost... Can you help me please? :thumbsup:

02-23-2011, 01:30 AM
Hello spacehill,
You should be able to center that after you fix some box model issues.
See the box model here (http://www.w3.org/TR/CSS2/box.html). The box model says that whatever you put inside an element cannot be larger than that element. margin/padding/border all could when figuring width/height.

You have 614px wide #apDiv6 containing 658px wide object. That doesn't quite work.

Since you are using absolute positioning, you can center #apDiv11 with just a couple more lines of code.
Try this -
#apDiv11 {
position: absolute;
width: 769px;
height: 476px;
z-index: 1;
top: 69px;
left: 50%;
margin: 0 0 0 -384px; /*where margin is 1/2 of elements width*/
/*left: 422px;*/

That's following this method of centering (http://bluerobot.com/web/css/center2.html).

02-23-2011, 01:59 AM
margin: 0 0 0 -364px; /*where margin is 1/2 of elements width*/

Thanks! You helped me so much! You're my hero!!!