Hi all,
I'm trying to create a CSS layout that is both vertically and horizontally centered. I've been trying absolute positioning for the first time, however working in percentages seems to give odd results, but if I work in pixels the layout would not appear correctly in different resolutions.
So far here is the code I've been playing around with, but I'm just getting frustrated as the numbers in pixels and percentages aren't giving (what I see as) logical displays.
CSS
#centrecontainer {
position: absolute;
top: 25%; }
#container {
border: 5px solid #000;
width: 760px;
height: 350px; }
HTML
<div id="centrecontainer">
<div id="container">
</div>
</div>
If anyone has any advice or knows of any tutorials in this style, I'd be grateful.
Hopefully the answer is staring me in the face and someone can point it out for me! It's probably something to do with my lack of "absolute positioning" knowledge, but any advice is appreciated![]()



Reply With Quote

Bookmarks