Quote:
Originally Posted by earl080688
hi!!! im earl and im new in css and im having trouble with my layout. first i want to have div that always in the center of the page so i use the code margin 0 auto, and it works.. but now i also want to make that div to have always 100% in height, but unfortunately i don't have any idea on how to do that, i already tried height:100% but it doest work. can you please help me with this please.... 
|
Well, maybe if you could post your code we can have a better understanding of your real situation there. Anyway, try the link below, it's about
CSS layout using percentage (%) value.
Absolute CSS Box (the method I used in my example)
This is one of the solution for your problem and I know there are many way to solve them. Just wait for other members in this forum to give their ideas.
- Code: Select all
<style type="text/css">
#content{
border: 1px solid black;
position: absolute; /*set the position to absolute and, */
width: 50%; /*set your div width to any percentage value (eg: 50%)and,*/
left: 25%; /*you know that your div is 50% of the screen and there is another 50% for the left and right, 25% each so move it 25% to the left.*/
top: 0; /*this one for the 100% width*/
bottom: 0; /*this one for the 100% width*/
}
</style>
Hope that helps..