Make site fit exactly width and height of browser?

It's impossible. No way you'd be able to fit your content to all display resolutions (think ipads, smartphones each with different resolutions, 30" monitors, etc). By the way: // both of these on their own do nothing.

$(window).height() // just returns to you the viewport height $(window).width() // just returns to you the viewport width.

Body {height: 100%; width: 100%;} div#page_container {height: 100%; width: 100%;} No need for JS/jQuery, just wrap all your content inside It also resizes with people resizing browser windows.

That wouldn't work unless you set overflow: hidden on the page container. But even then, if you did it, you'd be missing some or most of the content depending on your resolution and viewing device – Phil Jul 28 at 10:57 You just have to work with percentage for the nested elements width. This is anyways not viable for image-heavy content, where you are facing fixed sizes, but for a fluid layout, consisting of divs, you can make that work.

– Semyazas Jul 28 at 10:58 @semyazas, didn't do the trick, any idea? – Tovi Klein-Berzon Jul 28 at 11:00 jsfiddle. Net/7nM4E/1 See here for a live example, you would have to stick using percentage values.

And you would not be able to support all screen sizes, unless you would make EVERY content-container you use scrollable, which is not exactly eye-catching – Semyazas Jul 28 at 11:07 @semyazas what if the text/content inside of page_container div FORCES the its height to extend past the viewport size (Here's an example jsfiddle. Net/6UZnJ)? Here's that same example but with overflow: hidden (where you'll be missing some of the content): jsfiddle.Net/6UZnJ/1.

What do you propose for those cases? Don't forget that as the window is resized to a smaller width, the content increases the height even more. – Phil Jul 28 at 11:12.

I have to agree with Phil. There is going to be no way to determain the resolution of the users screen. That is going to be a user problem.

I have always built my web sites at 1024 x 768 resolution for that reason. Sometime even lower depending on the content, and the target audience(sites that target older people who probably have a low resolution setting so they can read their screen). This way, I know that my stuff will fit.

Most people now a days, with monitors the size that they are, do not go much below that. I found this code here at support.microsoft.com/kb/287171 that might help you though. This will adjust the screens height and width based on the users screen resolution.

Also remember that some JavaScript will not work in certain browsers. I have run into this problem with pop-ups when it came to changing screen size, scrollbars ect...

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions