[whatwg] How to improve the appearance of web pages

Behnam ZWNJ Esfahbod behnam at zwnj.org
Tue Mar 13 06:26:09 PDT 2007


Hi list,

Implementing a new web application from scratch, I found out some new
ideas to make the appearance of site better.  I'm not sure here are
the best place for this discussion, but at least it's not out of
interest.


First one is how Mozilla/Firefox do the zooming thing, "Text Size".
On web sites with images, changing the text size just works for +/- 2
levels.  More than that the whole page gets out of shape.  Seems Gecko
1.9/Firefox 3 is going to resize images, but I'm not sure.

BTW the first trick is how to make images "zoomable", by the ratio of
"Text Size".  I set an style attribute for each image (which are not a
lot, limited to the logos) which sets "font-size" to image's width (in
pixel) and set the image's "width" to "1em".  It works well on Fx2.0
and IE6.

The problem is there's no way to do it globaly, and I should add a
"style" attribute to each "img" tag.

Something I found weird is the default unit of images without width
and height attributes.  If there was a way to just set the default
unit of images to "em", the problem could be solved.


The second one is to get the web server decide which image file is
better.  An Apache httpd module can select the best response for a
request for image "the-company-logo" if it knows which size is needed,
and what mime-types are acceptable.

My idea is to add a field to the http request header for image files,
to let the server know which size the image is going to be shown, and
then it decides to send the best answer.  For example, I can use
"the-company-logo" for both header (let it be 192 pixels width) and
the signature (32 pixels width).  I just set the "width" attribute of
the "img" tag to "192px" for the first one, and "32px" for the other
one.  Well if there's no 192 pixels width file
("the-company-logo.192xXYZ.png" doesn't exist) and there exist a SVG
version, the servers knows the SVG version is better for this size,
and doesn't send the 32 pixels file.

Another usage is when the browser does the zooming.  When I zoom in
the page 200%, that's good if browser can get the company logo with
better quality.  It would be just another request for
"the-company-logo" with the 384 pixels width, and it may be a bitmap
or vector file again.

Of course the re-request process would consume the band-width, but it
will make user more more happier.  In fact, this way we can improve
the quality of the pages *on demand*.


I don't know if it's the first time for such proposals.  So please let
me know if one already exist.


Cheers,
-- 
    '     بهنام اسفهبد
    '     Behnam Esfahbod
   '
  *  ..   http://behnam.esfahbod.info
 *  `  *
  * o *   http://zwnj.org


More information about the whatwg mailing list