ankit
ankit

Reputation: 11

Size of the HTML page for all screens

I am new to web designing. I had just build a web page but now it is not looking accurate as it was built.

Right Now i have just built a container with:

#container {
    width:auto;
    height:auto;
    border:4px solid green;
}

Question: How do I fix the height & width of the page for all screens & sizes.

Upvotes: 1

Views: 78

Answers (2)

James King
James King

Reputation: 1917

Having height:100%; plus a 4px border will always exceed the height of the page, and will cause scroll bars to appear at all times

Upvotes: 0

Sowmya
Sowmya

Reputation: 26979

Here you go

html,body{
    height:100%;
    margin:0
}
.container
{ 
    width:auto; /*Since div is block element, it takes automatic full width*/
    height:100%;
    background:grey;
    border:4px solid green;
}

DEMO

Upvotes: 3

Related Questions