Vertical Align Page Canvas?
Started by
jennajonesdesign
, May 20 2012 05:25 PM
9 replies to this topic
#1
Posted 20 May 2012 - 05:25 PM
Hi! I saw another post about this, but doesn't look like he found a solution. I am working on a portfolio website. It looks great on a smaller screen, but on a bigger screen everything is way up at the top. I would like it to vertically center the page canvas the same way it is horizontally centered. Is this possible?
I have tried applying this: vertical-align: middle; with no effect.
One more thing to add to this. Do I have to have a fixed canvas height for this to work?
Thanks so much for your insight!
#2
Posted 20 May 2012 - 05:33 PM
What CSS selector are you adding the vertical-align attribute to? I don't think you have to have a fixed canvas height for this since
layers that use the attribute don't usually have a fixed height.
#3
Posted 20 May 2012 - 05:37 PM
Here is the code I have for that section:
#page-canvas {
background:white;
vertical-align: middle;
}
#4
Posted 20 May 2012 - 05:39 PM
I also tried it here:
.canvas #page-canvas
Sorry - I am not a css master. I just do a lot of trial and error. I appreciate your help.
Jenna
#5
Posted 20 May 2012 - 05:40 PM
Try this instead:
#6
Posted 20 May 2012 - 05:51 PM
Just tried that. You can check out the link. It just added a huge margin at the top, but not centered.
#7
Posted 20 May 2012 - 05:57 PM
I looked around and found this list of methods for vertical centering with CSS: You can try applying some of these methods to the layout to see which one works best.
#8
Posted 20 May 2012 - 06:21 PM
Thanks. I will try this out and post an update.
#9
Posted 20 May 2012 - 09:26 PM
Great. We hope it works!
#10
Posted 26 May 2012 - 03:34 AM
Couldn't figure out exactly what I was hoping for. Just added a footer instead and that seemed to add more vertical balance.










