2008/10/1 Lillian Sullam <[EMAIL PROTECTED]>:
> 2. In every part of my chunked document the text reacts to any "hovering" of
> the mouse.  This should not happen, not all of the text is a link.
[...]
> I have a feeling this has to do with the <a> tag being closed with a "/"
> instead of </a>, but why is this happening?

I think you're right, and you'll see the behaviour you describe if
your browser is interpreting the file as plain HTML rather than XHTML.
In plain HTML the </a> closing tag is mandatory, and I guess the
browser is treating the <a.../> as an opening tag (and acting as if
there's a closing tag later in the document) rather than an empty
element.

This appears to be fixed, in Mozilla at least, if you set up your web
server to serve XHTML files with the content type
application/xhtml+xml instead of text/html (or, if you're loading
straight from disk without a web server, try naming the files with
.xhtml extensions instead of .html). However this might not fix the
problem in all browsers and causes problems in some browsers, so if
you're thinking of setting up a web server like this have a look at:

http://www.xml.com/pub/a/2003/03/19/dive-into-xml.html

and maybe also look for newer articles, since that one's from 2003 and
predates Internet Explorer 7 among other browsers.

If you use the stylesheets' HTML rather than XHTML output I think
you'll get closing tags and results that will generally be OK with the
text/html content type.

Or, if you're only worried about the mouse hover behaviour, you can
change your CSS. I guess you have a CSS rule with a selector including
"a:hover" and maybe also "a:active". If you change that to
":link:hover" or "a:link:hover" (and ":link:active" etc) it won't
affect <a> elements that aren't links, like the anchors here. This
might be enough, but there could be other consequences of the browser
treating XHTML as HTML. These <a> elements will still act as if they
cover text they're not meant to, and similar things might be happening
elsewhere, so you might find that CSS rules or JavaScript DOM access
don't work as expected.

Hope this helps,

Andy

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to