Santosh
Santosh

Reputation: 852

JSP/ HTML page resolution

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.

Upvotes: 0

Views: 4600

Answers (2)

Quentin
Quentin

Reputation: 944171

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).

Upvotes: 1

bobince
bobince

Reputation: 536615

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.)

Upvotes: 1

Related Questions