Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Centering the page

    https://dl.dropbox.com/u/11571434/index.html

    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?

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,737
    Thanks
    22
    Thanked 1,836 Times in 1,820 Posts
    Hello spacehill,
    You should be able to center that after you fix some box model issues.
    See the box model here. 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 -
    Code:
    #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.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    margin: 0 0 0 -364px; /*where margin is 1/2 of elements width*/

    Thanks! You helped me so much! You're my hero!!!
    Last edited by spacehill; 02-23-2011 at 03:16 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •