On Sun, 03 Oct 2004 09:41:32 GMT, "Doc"
<do*********@REMOVEhotmail.com> wrote:
I've read in a couple of different places including the archives of this
forum that html doesn't allow you to precisely dictate the position of an
image,
True, but with constraints.
The other posters have explained the technical detail behind the
contradiction you've found. They're right, but I'd suggest that their
point is also (and more importantly) irrelevant.
The crucial thing to understand here is the difference between HTML
and DTP (possibly the smartest decision TBL got right with the first
web). DTP (Desk Top Publishing) allows you to precisely design a page
on a known piece of paper. If you switch it transatlantic and move
from US Legal to A4 paper, you need to rework the layout or else
things hang over the edges and don't get printed.
HTML isn't like this. In HTML, everything fits onto the page and the
virtual page is a long scrolling view through a physical window that
depends on your device. If you have a wide screen device, the virtual
page wraps to be "short and fat", with long lines. If the device
window is narrow, then the page re-wraps to be long and thin, with
shorrt lines. For a "world wide" web, it's important to have this
feature because you do not (and cannot) know the characteristics of
the user's browser device.
So in HTML, you can't "precisely dictate the position of an image".
This is by design, because it's not a good thing to be trying to do.
With some features of HTML, then you can attempt to do this. The 1x1
spacer gif was an early attempt. This is thoroughly obsolete as a
technique (beyond 1997) and you should now _burn_ any book that
suggests using it. First you should read the apologia by the guy who
invented the technique - it's on the web and explains why he's sorry
he did it ! Similar, but slightly less extreme, comments apply to
the mis-use of tables for layout purposes.
With the code example you show, you're using CSS and absolute
positioning to control the position. This is a much better and almost
stable technique. It's still not a solution though. Yes, you can
"control the position" now. The problem is that the web is still as
unpredictable as ever and you cannot know the capacity of the user's
browser. If you use CSS to position an image 300 pixels from the left
border, then this is _suggesting_ a position to be used. There's no
guarantee that the device will support this, either by CSS, or by
simply not having 300 pixels of width to work with. It may not even
have any pixels at all, if it's a pure-text mode or speech-only
browser.
You can now "precisely dictate the position of an image" perfectly
well - but the device is under no compulsion to _follow_ your dictat !
One of the most important questions in web design at the moment is
"How should your page degrade if a particular feature is unavailable?"
You must _never_ take the attitude of "This page requires IE5 to view"
or "This page requires 800x600 screens" - these questions are simply
outside your control, and will always be so. Don't ask "What do I
need?", ask instead "What happens if I don't get it?". For a
well-designed page, your page degrades gracefully when constrained -
it might not look so good, but it will still _work_.
Web browser windows are getting smaller these days. Maybe desktop
screens are getting bigger, both physically and by pixel count, but
that's causing users to use smaller windows as much as to dedicate all
of that screen to one web page. There's also a _major_ shift
happening to portable devices, many of which have very small screens.
Good CSS-based and device independent design will work on a mobile
phone _now_, without needing to re-work the pages.
--
Smert' spamionam