Center Box with CSS

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I've this CSS code:

#content {
 padding: 10px;
 margin-top: 10px;
 margin-bottom: 10px;
 margin-right: auto;
 margin-left: auto;
 background-color: #333333;

that center orizzontally the content box but if I need to center vertically
too how can I do?

Thanks so much !!

Re: Center Box with CSS says...
Quoted text here. Click to load it

<div style="position:absolute;height:100%;width:100%">
    <div style="position:absolute;top:50%;left:50%">Hey</div>

This will open the word "hey" (or the contents of that div) in the
center of the browser window. You can take the needed pieces and use it
in your css.

Whitecrest Entertainment

Re: Center Box with CSS

Entity Quijote spoke thus:

Quoted text here. Click to load it
Ah, the eternal vertical centering problem!
There's a good analysis and solution here:

-- Gnarlie
Currently broadcasting from

Site Timeline