asim.ali314
asim.ali314

Reputation: 41

How to set a webpage content to 100% on any screen resolution?

I am designing my first webpage. I have completed almost all the work but now the problem lies in screen resolution. I start designing on 1920x1080p of screen resolution but when i check it on 1080x768p screen the content was missing and overlapped. Now i set the screen size of my Laptop to 1080x768 and set the webpage but while I turned it back to 1920x1080 on the right side content was missing mean only in the 1080x768p screen while i have used following code.

body {width:100%; hight:100%;}

It just fills the background images to full screen while content does not displays on full screen what to do any help?

Upvotes: 1

Views: 5087

Answers (1)

Elad Shechter
Elad Shechter

Reputation: 4045

you need to add to html and the body

html,body{
    height:100%;
}
/**reset padding of body**/
body{padding:0;}

(the width of 100% is auto)

LIVE EXAMPLE

Upvotes: 1

Related Questions