...

View Full Version : Simple problem, why does it not work?



ivoog
03-11-2009, 07:28 PM
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!

Excavator
03-11-2009, 07:38 PM
Hello ivoog,
See if this helps you any -

#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

ivoog
03-11-2009, 07:49 PM
Thanks! It seems so hard to fully learn HTML and CSS



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum