...

View Full Version : Why no gap between <acronym> and <a> ???



beetle
01-10-2003, 04:22 PM
I've got some perfectly valid XHTML on this page (http://www.peterbailey.net/new/site.php?page=standards) that when viewed in Mozilla creates an odd behavior.

The problem
The space between my <acronym> tag and my <a> tag doesn't show up in Mozilla.

The code
<acronym title="Web Standards Project">WaSP</acronym>&amp;nbsp;<a href="http://www.webstandards.org/act/campaign/buc/">website</a>

Looks ok in IE. Any clues? I've also tried this with a regular space, a regular space on either side or both sides of the &amp;nbsp; and even en &ampemsp;

brothercake
01-10-2003, 04:53 PM
Just a guess, but would

acronym { display:inline; }

make a difference ..?

beetle
01-10-2003, 05:33 PM
Thanks for the idea brothercake, but no dice. :(

brothercake
01-10-2003, 05:50 PM
Maybe use a different tag ... not familiar with <acronym> - does it have a semantic purpose over, say, a <span> ??

jkd
01-10-2003, 05:55 PM
Originally posted by brothercake
Maybe use a different tag ... does <acronym> have a purpose that makes it more useful than, say, a <span> ??

Yes!

<acronym title="Maine School of Science and Mathematics">MSSM</acronym>

Provides enough information for "MSSM" to be understood.

If I was talking about my high school on a web page, what does <span>MSSM</span> mean? Nothing at all. <acronym> provides a clean way of defining acronyms so that people not in the know can still understand them.

Mozilla even provides visual hints for <abbr> and <acronym> with a dotted underline.

beetle
01-10-2003, 06:16 PM
Thanks, jkd. And you're right, I have noticed that Mozilla gives the little dotted underline when not styled (http://www.peterbailey.net/new/site.php?page=standards&css=no) by CSS.

<acronym> is no different from any other phrase element such as em, code, cite, etc...

So, jkd, any clue why I'm not getting my space?

jkd
01-10-2003, 06:31 PM
Originally posted by beetle
So, jkd, any clue why I'm not getting my space?

I see a space when the page is loading, however after the page is done, it collapses. Very, errr... peculiar behavior.

I'm going to look into it a bit more throughout the day.

jkd
01-10-2003, 06:37 PM
I can tell you it is not a recent regression at least.

I've looked at it in various 1.1, 1.2, and 1.3 builds, as well as various Phoenix releases and K-meleon 0.7, only to get the same behavior each time.

And don't ask why I have 7 different Gecko browsers on my hard drive... I don't know either. ;)
It helps a little for regression hunting, but if I did it for that, I would grab 1.02 or something as well...

Bosko
01-10-2003, 06:37 PM
Strange indeed,because Konqueror does display a space.

I have noticed that when you create a XHTML page with the .xhtml extension Konqueror does not display spaces around acronyms (but Mozilla does).

jkd
01-10-2003, 06:46 PM
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>&lt;acronym&gt; test</title>
</head>
<body>
The <acronym title="Maine School of Science and Mathematics">MSSM</acronym> <a href="http://www.mssm.org">here</a>
</body>
</html>


Works as expected in Moz. I was thinking that the collapsed space might have something to do with the immediate anchor afterwards, but obviously that is no longer the case. With markup rendering out of the way, I'm afraid it might be a styling system issue, which may hard to pinpoint. I'll keep thinking about it though.

brothercake
01-10-2003, 07:05 PM
Originally posted by jkd
Yes! [...]

That's interesting; thanks.

I tried the example in Moz 1.2a and Netscape 7.01 and it works absolutely fine ..?

beetle
01-10-2003, 07:11 PM
Originally posted by jkd
I see a space when the page is loading, however after the page is done, it collapses. Very, errr... peculiar behavior.Argh!!! jkd, I'm glad you said that becuase it made me look at my code again, closely.

When I started building this site I was using one of those whitespace cleaner functions for Mozilla. Since further educating myself on the subject I opted to discontinue it's use. However, it appears That at some point I overwrote my files with a version that still had the mentioned cleaner function intact, and it's been there ever since.

Removing that function (again) fixes the problem. Thank you all for being patient with my boneheadedness. :rolleyes:

jkd
01-10-2003, 07:13 PM
LOL! I never expected that one. :D

MrDoubtFire
01-11-2003, 09:31 PM
<acronym title="Maine School of Science and Mathematics">MSSM</acronym>

Provides enough information for "MSSM" to be understood.

If I was talking about my high school on a web page, what does <span>MSSM</span> mean? Nothing at all. <acronym> provides a clean way of defining acronyms so that people not in the know can still understand them.



Just as an aside:

<span title="Maine School of Science and Mathematics">MSSM</span>

...works in the same way as what you wrote.

But, since you got your problem fixed, it was just an interesting point. Also, not sure if it's cross-browser compatible or not.

MrDoubtFIre

beetle
01-11-2003, 09:48 PM
Yes, MrDoubtFire, that is true. And it's not.

The resulting title tooltip is the same for both, but consider these differences. And <acronym> is perfectly valid HTML.

The <acronym> tag denotes acronym, just the same way <b> denotes bold, <code> denotes code and <em> denotes emphasis. <span> denotes nothing. <span> and <div> are customizable line-level and block-level elements that carry no semantic meaning of their own.

Also, consider this. Let's say (as on my site) you want all of your acronyms to have a specific underline. Using <span>s I'd have to assign a class to each one and style them with a class selector. Using <acronym>s I'd just have to style them with an element selector. Much easier =)

Oh, and as it's been mentioned, Mozilla render's unstyles <abbr> and <acronym> elements with a dotted underline.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum