...

View Full Version : Vertical Alignment of a div on a page



darkmaster
05-13-2006, 11:10 PM
Hi All

I'm sorry if this has already been asked somewhere else on this forum, I searched but could not find anything.

Im am trying to get a div to verticly align on a page (dynamicly) so it centres verticly on a page, i have tried many ways in CSS to no avail does anyone have any suggestions?

Thanks

Tom

nathan_lamothe
05-14-2006, 12:16 AM
Not sure what you mean... but maybe like this:


<html>
<head>
<style type="text/css">
.centered{ margin:25% 0% 25% 0%;
border: 2px solid blue;
min-height:25%;

}
</style>
<body>
<div class="centered">
<p> All your base go here. <br/><br/><br/><br/></p>
</div>
</body>
</html>

more code would help...

darkmaster
05-14-2006, 12:48 AM
You a legend, that works!

Thanks

nathan_lamothe
05-14-2006, 12:59 AM
<hoping it still works when used in a page full of stuff...>

Glad to help.

playing with my copy, that min-height line isn't actually doing anything... but if you switch it to px instead of % it does... I thought min-height was supposed to work with both?

darkmaster
05-14-2006, 03:08 PM
It didnt when I tryed to plug it in to my current site design, I've scrapped the idea now

Thanks for your help anyways:thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum