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 Coder
    Join Date
    Feb 2009
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Simple problem, why does it not work?

    http://www.ivoog.com/test/help

    I'm trying to make all of the "payment" buttons centered. So that it would be 4 on the top and 4 on the bottom centered in the middle. How would I do this? I always have these simple problems that I cannot figure out.

    The CSS for this is:

    #othermain2 {
    width:850px;
    height:850px;
    float:left;
    }
    #middlestyle {
    width:850px;
    height:850px;
    text-align:center;
    }
    .middlebox {
    width:100px;
    height:100px;
    text-align:center;
    float:left;
    }

    and the html is on the page. BEST ANSWER WILL BE CHOSEN WHOEVER ANSWERS CORRECTLY FIRST! What do I need to change? Thanks!

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello ivoog,
    See if this helps you any -
    Code:
    #middlestyle {
    	width:400px;
    	text-align:center;
    margin: 150px auto; /*moves div down 150px and centers*/
    overflow: auto; /*clears floats*/
    background: #f00; /*just for testing*/
    }
    .middlebox {
    	width:100px; 
    	text-align:center;
    	float:left;
    }
    I removed the height from both of those divs to let them size to their content.
    You had .middlebox set to height:100px; but your putting about 120px in it.

    Read about clearing floats like that here - http://www.quirksmode.org/css/clearing.html
    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 Coder
    Join Date
    Feb 2009
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy

    Thanks! It seems so hard to fully learn HTML and CSS


  •  

    Posting Permissions

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