Re: Inconsistent results - why?



RobG wrote:
Robert Baer said on 10/04/2006 11:48 AM AEST:

RobG wrote:

Robert Baer said on 10/04/2006 9:36 AM AEST:

<SWM.HTM listing; does not work; positioning wrong (below main GIF)>
<!-- IE adds a horizontal 4-icon strip near the upper left
corner when that area is visited (WTF?) -->




I guess that is IE's image toolbar. You can turn it off/on in:

Tools->Internet options->Advanced->Multimedia->Enable image toolbar


*** Oh; thanks.


Is there a question here? If you wondering why your page behaves strangely, you need to start with valid HTML. You have invalid attributes and elements outside the body element. What various browsers do with it will likely be different (or maybe not).


** Well, right or wrong, the first one does not work, and the second one does and ther is no meaningful difference.


There is, it is the '/' at the end of the opening A tag in the first (non-working) version. Your HTML is 'tag soup', that is, the browser has not been given a DOCTYPE so it must guess how to interpret the markup. It also encounters a variety of invalid attributes and markup, so it will use 'quirksmode', which is used whenever the browser is utterly confused as to what the markup is supposed to do and does its best to display something.


That is the question.


It was answered - your awful markup was the issue. You can validate markup here:

<URL:http://validator.w3.org/>


Keep working at it until you get "This document is valid...". Work on the first couple of errors each time, often they will cause cascading errors elsewhere that go away when you fix the first ones.

By the time you get a valid document you will have learned a lot about HTML. There is also a CSS validator when you get around to that.


However, making fixed is very helpful.
"invalid attributes and elements": i do not have a clue where or what should be.


Use the W3C validator and HTML specification.


It's the dancing bear syndrome: wonder not how well the bear dances, but that it dances at all. :-)


<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Stripper wells and production</title>
</head>

<SCRIPT LANGUAGE="JavaScript">




The language attribute is deprecated, type is required.


** If i leave the "<meta ..." line out, no difference is seen; the two


The meta tag is irrelevant here, as you've discovered. It's purpose is largely for validation and fallback if the server fails to set the content type (the server should always set it).


HTML progs still work differently.
Same difference whether IE or NS is used.


Because your markup is so full of errors that whatever various browsers may make of it is likely different. And there are different errors in the two examples you posted.

There are lots of browsers other than IE and Netscape Navigator.

[...]


There is no 'centered' attribute in HTML 4.


** Maybe, but i have seen it and it works for IE and NS.
But i could use absolute position and hand calculate the proper point.


There is no requirement to do that. You don't know how wide the window is and you don't need to know. Learn more about HTML and CSS, ask such questions in a relevant new group. But before you do, search their archives and find other posts that ask the same question.

HTML:
news:comp.infosystems.www.authoring.html

CSS:
comp.infosystems.www.authoring.stylesheets


Some readers there aren't very tolerant of newbies, persist anyway.


[...]

Mouseovers are frequently done with CSS now as it's more efficient than pre-loading images, investigate that. If your document is small and only has two images, pre-loading seems pointless.


** CSS? what is that? would rather kiss as much as possible, as i know so little.


Be careful what you kiss, it may bite :-)


And the app will have a fair number of good-sized images.


Below is an example of what I was referring to, it may not be suitable for you. Follow-up in a CSS group:

<URL:http://wellstyled.com/css-nopreload-rollovers.html>


Abusing an A element this way is only necessary because IE doesn't support hover on other elements - but that will change with IE 7 I think.

Poke around alistapart, most of it is pretty good.

<UR:http://www.alistapart.com/>


Here is a brief, valid, document with an image that stays centered regardless of what size the browser window is (provided there's room of course):


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd";>
<html>
<head>
<title>Center Image</title>
<meta http-equiv="Content-Type"
content="text/html; charset=ISO-8859-1">

<style type="text/css">
#centerImage {text-align: center;}
</style>

</head>
<body>
<div id="centerImage"><img src="a.gif" alt=""></div>
</body>
</html>



I made the changes you suggested on both files, and the "working" one still works and is !less! that 12 lines of code!!
---And no JavaScript!
I dare say that the trick(s?) you mentioned cannot be found in any on-line HTML tutorial.
But the non-working one still would not work, and looked exactly the same.
I pressed the DOS FC utility to work on them, and there were two areas it complained about, and visually, those areas were absolutely identical.
I am guessing that the bad file had embedded control characters or hex255 (which is just as invisible as a space).
I did not look at the bad file in hex mode; i was so disgusted that i just tossed it.
So, the next step is to use that nifty utility.
Thanks!
.


Loading