In article
<NOwebmasterSPAM-B8650C.06333827112007@freenews.iinet.net.au>,
Eric Lindsay <NOwebmasterSPAM@ericlindsay.comwrote:
Quote:
How do you provide a consistent gradient fill as a background in a
liquid layout?
>
If I make a gradient fill image say 1000 pixels wide (and repeat it down
the page) to suit a typical computer display, then only a small portion
of the gradient will show if the viewpoint is a smaller PDA or phone
display.
>
Which is why you need to carefully make a gradient to suit the
particular needs of the page. If, for example, you have set aside
a certain number of pixels for a left col in the html, and you
want everyone to see a nice colour there shading off to the right
to a more neutral bg colour (say the same as the body, perhaps
white), then it is easy, you just make a not all that wide one
and repeat it down. If you really want to have a gradation
showing from left to right on the very smallest to the very
biggest of screens, you make a *very* wide (but tiny height
pixeled) one.
There are many costs and benefits depending on exactly what you
want. There is no general answer to your question. Post a url of
something you roughly want in a realistic sort of page.
Quote:
On the other hand, if viewed full screen on a 1920 pixel wide display, I
would run out of gradient on one or both sides of the page.
Which means you have made too small a bg pic. There is little
bandwidth cost in wide or tall if you have the *other* dim tiny
(like 1px)
Quote:
I could
repeat the two end colours of the gradient fill horizontally to fill out
the display, but then I don't have a consistent gradient.
Best not to repeat gradients. Fraught with difficulties.
Quote:
>
More generally, how do you best make an image fill an available
container, whether this is the entire viewpoint, or just as a background
of a div?
bg is a straightforward issue. As for <img src=""...in the
html, you can give the size in % of the container (body or less)
if you are prepared to steer your way through two big issues:
(1) If you make the pic bandwidth frindly, it will likely look
terrible blown up by a browser
(2) If you make a nice big pic that is of acceptable bandwidth
strain, it will look absolutely smashing at all sizes that are
smaller on a Mac and bloody awful on IE and not great on any
Windows machine. That is my experience so far.
Quote:
Do I just give the image a size of 100% of its container? I
was under the impression it was a really bad move to use anything except
pixels as the size of an image.
It is not a really bad move for particular types of graphic or
particular types of pics. If you just do it willy nilly then this
is a very bad move. <g>
Quote:
However with lots of browsers now
resizing images anyhow, it seems less and less reasonable to restrict
all my images to their original pixel size.
No, you don't want to follow anyone or anything in making bad
moves. That some browsers do it does not make it reasonable for
you to do it. The reasons for a browser doing it are not
necessarily applicable to an intelligent human.
--
dorayme