Centering content horizontally AND vertically with CSS?

L

Lenny

I want the content to be dead center no matter how big the browser
window is. I can get it horizontally but I can seem to get the < div >
to center vertically. Any suggestions?

Thanks
Lenny
 
A

Andy Holmes

Lenny said:
I want the content to be dead center no matter how big the browser
window is. I can get it horizontally but I can seem to get the < div >
to center vertically. Any suggestions?

Thanks
Lenny


Keep in mind, or note if you didn't know already, that the height of
block elements such as <body>, <p> or <div> is defined by their content
unless specifically told to be bigger. So technically it is vertically
centered.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top