AlexOC
10-12-2008, 06:35 PM
Well, I've seen alot of people wanting to center divs, Horizontally and Verticaly so its right in the middle, and alot of people want to put a div right at the bottom.
Well i thought i'd post it here.
Centering Divs
Horizontally
margin-left: auto;
margin-right: auto;
Or
margin: auto;
Horizontally And Vertically
top: 50%;
left: 50%;
margin-top: -**px; **=Half Of DIVs Height
margin-left: -**px; **=Half Of DIVs Width
position: absolute;
Foot Divs
width: 100%; Optional, If you want a centered foot, refer to above.
top: 100%;
margin-top: -**px; **=ALL Of Divs Height, Not Half
position: absolute;
Vertically+Horizontally Centered And Foot Div Can Be Seen Here (http://ohabbo.com/FACE.htm)
Well i thought i'd post it here.
Centering Divs
Horizontally
margin-left: auto;
margin-right: auto;
Or
margin: auto;
Horizontally And Vertically
top: 50%;
left: 50%;
margin-top: -**px; **=Half Of DIVs Height
margin-left: -**px; **=Half Of DIVs Width
position: absolute;
Foot Divs
width: 100%; Optional, If you want a centered foot, refer to above.
top: 100%;
margin-top: -**px; **=ALL Of Divs Height, Not Half
position: absolute;
Vertically+Horizontally Centered And Foot Div Can Be Seen Here (http://ohabbo.com/FACE.htm)