Pedro
Pedro

Reputation: 575

Centering elements in screen - ignore browser resizing

I'm creating a "Site under construction" ilustration, but I'm having some dificulties in achieving the desired result. This is what I want:

enter image description here

Basically I want to center the 3 divs simultaneously - each one in it's own container (the siteUnderConstruction_bg must be centered in the body). As the browser resizes, the entire content should center intself on-the-fly.

HTML:

<div id="siteUnderConstruction_bg">
    <div id="siteUnderConstruction_text"></div>
    <div id="siteUnderConstruction_bars"></div>
</div>

Here's a FIDDLE.

Help?

Pedro

Upvotes: 1

Views: 86

Answers (1)

Robert McKee
Robert McKee

Reputation: 21477

Jsfiddle: http://jsfiddle.net/NRrRt/1/

Add background-position: top center to the text and bars divs.

Upvotes: 1

Related Questions