kosto
kosto

Reputation: 84

CSS, page resolution independent webpage

I want to achieve result as drawn on the image (red square is region, always fixed size, black square is the screen). I have no idea how to do this, unless here is a magical way of getting current size of screen and using conditional statements in CSS. Thanks!!

Here is the img: http://glothriel.org/uploads/layout.png

Upvotes: 1

Views: 539

Answers (1)

Andy
Andy

Reputation: 14575

You can do it with a fixed width div and margin: 0 auto;

div {
    width: 500px;
    margin: 0 auto;
    height: 500px;
    background: red;
}

DEMO

Upvotes: 2

Related Questions