views:

341

answers:

2

I have to make a JSP/HTML pages. How to fix height and width on JSP for resolution, which will work for all kind of monitor resolution. If you open page then that must be fit and look good in any kind of monitors.

Please advise, how to put height and width in JSP.

A: 

You don't have to do anything. HTML pages, whether static or generated by JSP, work on all monitor resolutions by default. Everything is laid out to fill the width of screen you have (‘liquid layout’).

It's only when you actively defeat this feature, by ‘fixing height and width’, using a method such as:

<table width="750">

or CSS:

body .page { width: 750px; margin: 0 auto; }

that you have problems with pages being inconvenient on unexpected resolutions. Leave them alone, or set widths in percentages instead, and you'll be fine.

(In practice most pages are a mixture of fixed-size and variable elements, but making sure the main textual content is in a liquid container is the most important thing to avoid the dreaded horizontal scrollbar.)

bobince
+1  A: 

First — forget about the JSP. It is a server side technology. It's only relationship to anything that happens on the client is what code you output from it.

Second — read the Any Size Design FAQ

Third — read the Opera WSC. The section on CSS (the presentation language of the WWW) should be a priority (but you need a good HTML foundation first).

David Dorward