I'm trying to just get a div tag to be 100% height and centered horizontally. I've given the html the necessary 100% height for it to work.
The problem I see is this:
In order to have it horizontally centered, it needs to be position: relative. So here's the CSS I use to try to accomplish this along with the 100% height:
But alas! Although centered, it isn't 100% height. So next I change the position to absolute:body { height: 100%; padding: 0; }
#centered { background-color: #f4f4f4; position: relative; width: 500px; height: 100%; visibility: visible; margin: 0 auto; }
Now it's at 100% height sure enough, but it aligns to the left of the screen.body { height: 100%; padding: 0; }
#centered { background-color: #f4f4f4; position: absolute; width: 500px; height: 100%; visibility: visible; margin: 0 auto; }
Is there any way to accomplish this? Thanks!










Bookmarks