By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,677 Members | 1,877 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,677 IT Pros & Developers. It's quick & easy.

Problem validating an image map (html 4.01)

P: n/a
I'm stuck trying to validate an html 4.01 page that uses an image map.

I copied the second client-side example from here:
<http://www.w3.org/TR/html401/struct/objects.html#h-13.6>

and implemented it here:
<http://www.chem.utoronto.ca/coursenotes/analsci/chrom/hplc.html>

but the W3C validator complains that:

"document type does not allow element "MAP" here; missing one of "P",
"H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV", "ADDRESS" start-tag"

I've tried various combinations to get this to work, without success.

Am I missing something obvious, or is there a problem with either the
example or the validator?
Jan 2 '06 #1
Share this Question
Share on Google+
8 Replies


P: n/a
David C. Stone>:
I'm stuck trying to validate an html 4.01 page that uses an image map.

I copied the second client-side example from here:
<http://www.w3.org/TR/html401/struct/objects.html#h-13.6>

and implemented it here:
<http://www.chem.utoronto.ca/coursenotes/analsci/chrom/hplc.html>


You didn't copy it as the example is laid out. Look again.

--
Rob McAninch
http://rock13.com
Jan 2 '06 #2

P: n/a
David C. Stone wrote :
I'm stuck trying to validate an html 4.01 page that uses an image map.

I copied the second client-side example from here:
<http://www.w3.org/TR/html401/struct/objects.html#h-13.6>

and implemented it here:
<http://www.chem.utoronto.ca/coursenotes/analsci/chrom/hplc.html>

but the W3C validator complains that:

"document type does not allow element "MAP" here; missing one of "P",
"H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV", "ADDRESS" start-tag"

I've tried various combinations to get this to work, without success.

Am I missing something obvious, or is there a problem with either the
example or the validator?

Your <map> should be nested inside your <object>, e.g. like this:

<p class="centred">Parts of an HPLC:<br>
<object data="./hplc.gif" type="image/gif" longdesc="" usemap="#lcmap">
<map name="lcmap">
<ul>
<li><a href="#inject" shape="rect" coords="65,145,95,180">Injection
valve</a></li>
<li><a href="#columns" shape="rect" coords="0,165,64,216">Columns</a></li>
<li><a href="#pump" shape="rect" coords="95,145,250,216">Pump</a></li>
<li><a href="#solvent" shape="rect"
coords="120,10,210,120">Reservoirs</a></li>
<li><a href="#detect" shape="rect" coords="0,43,75,164">Detectors</a></li>
</ul>
</map>
</object>
<br class="bmyi">
This image shows a typical bench-top HPLC system.
Click on the different parts of the image for more information.
</p>
Your anchors should be coded like
<h2><a name="inject">Injection Valve</a></h2>
and not like
<h2><a name="inject"></a>Injection Valve</h2> (<- this is an empty anchor)

Also, note that float: middle is invalid CSS code and is therefore a css
declaration which will be ignored everytime by all browsers
img.centred {
border-left: 5pt solid white;
border-right: 5pt solid white;
float: middle
}

If you want to horizontally align elements (inline or block-level), then
may I suggest this tutorial:

Interactive demo on CSS horizontal alignment and horizontal formating
http://www.gtalbot.org/NvuSection/Nv...Alignment.html

Gérard
--
remove blah to email me
Jan 3 '06 #3

P: n/a
In article <FM******************************@adelphia.com>, Rob
McAninch <ro****@excite.com> wrote:
David C. Stone>:
I'm stuck trying to validate an html 4.01 page that uses an image map.

I copied the second client-side example from here:
<http://www.w3.org/TR/html401/struct/objects.html#h-13.6>

and implemented it here:
<http://www.chem.utoronto.ca/coursenotes/analsci/chrom/hplc.html>


You didn't copy it as the example is laid out. Look again.


[homer] D'oh! [/homer] dang end-tags....
Jan 3 '06 #4

P: n/a
In article <41*************@uni-berlin.de>, Gérard Talbot
<ne***********@gtalbot.org> wrote:
David C. Stone wrote :
I'm stuck trying to validate an html 4.01 page that uses an image map.

I copied the second client-side example from here:
<http://www.w3.org/TR/html401/struct/objects.html#h-13.6>
[snip]
Your <map> should be nested inside your <object>, e.g. like this:
Not necessarily - see the example cited above. My problem was I had
added a trailing </p> where there shouldn't have been one.

[snip]

Your anchors should be coded like
<h2><a name="inject">Injection Valve</a></h2>
and not like
<h2><a name="inject"></a>Injection Valve</h2> (<- this is an empty anchor)
Thanks, hadn't realised that.
Also, note that float: middle is invalid CSS code and is therefore a css
declaration which will be ignored everytime by all browsers
img.centred {
border-left: 5pt solid white;
border-right: 5pt solid white;
float: middle
}

If you want to horizontally align elements (inline or block-level), then
may I suggest this tutorial:

Interactive demo on CSS horizontal alignment and horizontal formating
http://www.gtalbot.org/NvuSection/Nv...Alignment.html


Thanks for the suggested tutorial - I'm still trying to get a handle on
the details of CSS, and it's sometimes a little confusing. Some of the
attributes are notated and work similarly to the way the equivalents
did under pre-CSS html, and some aren't/don't. It's like learning
French in France, then trying to hold conversation in Quebec...
Jan 3 '06 #5

P: n/a
In article <41*************@uni-berlin.de>,
Gérard Talbot <ne***********@gtalbot.org> wrote:
Your anchors should be coded like
<h2><a name="inject">Injection Valve</a></h2>
and not like
<h2><a name="inject"></a>Injection Valve</h2> (<- this is an empty anchor)


What is wrong with empty anchors? I thought they were allowed?
<!ELEMENT A - - (%inline;)* -(A) -- anchor -->

Are there actually existing user agents (not Mosaic) that do fail to
find them? Or is this a theoretical problem? I ask because the quick
way to solve some validation problems on my old pages involved ending up
with a lot of empty anchors. If I don't really need to improve my
anchors I'd rather avoid the work. Also I wasn't sure whether using an
attribute name="top" or name="bottom" in some other element was better
supported as a link target.

--
http://www.ericlindsay.com
Jan 4 '06 #6

P: n/a
On Wed, 4 Jan 2006, Eric Lindsay wrote:
In article <41*************@uni-berlin.de>,
Gérard Talbot <ne***********@gtalbot.org> wrote:
Your anchors should be coded like
<h2><a name="inject">Injection Valve</a></h2>
and not like
<h2><a name="inject"></a>Injection Valve</h2> (<- this is an empty anchor)
What is wrong with empty anchors?


They didn't work on some old browsers. I'm not aware of any that need
to be taken seriously nowadays - but then, if you weren't aimimg for
back-level compatibility, you'd use id= nowadays anyway; so, if you're
going to use <a name=...> at all, I'd recommend going all the way and
including some of the targetted text in the anchor.
I thought they were allowed?
<!ELEMENT A - - (%inline;)* -(A) -- anchor -->
In that sense they are "allowed", yes.
I ask because the quick way to solve some validation problems on my
old pages involved ending up with a lot of empty anchors.


Perhaps if you would be more specific about what problem that was
meant to solve, there could be a better answer. Otherwise, you can
just disregard the advice - I can't recall now which browser/versions
were affected.
Jan 4 '06 #7

P: n/a
In article <Pi*******************************@ppepc62.ph.gla. ac.uk>,
"Alan J. Flavell" <fl*****@ph.gla.ac.uk> wrote:
On Wed, 4 Jan 2006, Eric Lindsay wrote:
What is wrong with empty anchors?
I ask because the quick way to solve some validation problems on my
old pages involved ending up with a lot of empty anchors.


Perhaps if you would be more specific about what problem that was
meant to solve, there could be a better answer. Otherwise, you can
just disregard the advice - I can't recall now which browser/versions
were affected.


No serious problem, and it just seemed a safe interim move that would
later let me wipe all the empty anchors in a single move. I'm finally
converting to valid strict 4.01 a 400 page hand written site many years
old that hasn't much consistency, and doing it while the site is live.

One of the bulk search and replaces was easier with empty anchors, so I
have about 600 of them left. Once I get a bit more semantic structure
and consistency in the divs I'll probably go to id for anchors. It just
takes time because I can't figure out how to safely automate some of the
conversions, so I am having to rethink details of my approach as I spot
each conversion problem. Each directory is different, so I can't often
hit all 400 files at once.

Each time I close up a great swag of optionally unclosed tags like lists
and paragraphs my validation fails because of inconsistencies in my
original pages. However batch validation is wonderful for showing where
general problems are.

--
http://www.ericlindsay.com
Jan 4 '06 #8

P: n/a
Gérard Talbot wrote:
David C. Stone wrote :
I'm stuck trying to validate an html 4.01 page that uses an image map.

I copied the second client-side example from here:
<http://www.w3.org/TR/html401/struct/objects.html#h-13.6>

and implemented it here:
<http://www.chem.utoronto.ca/coursenotes/analsci/chrom/hplc.html>

but the W3C validator complains that:

"document type does not allow element "MAP" here; missing one of "P",
"H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV", "ADDRESS" start-tag"

I've tried various combinations to get this to work, without success.

Am I missing something obvious, or is there a problem with either the
example or the validator?


Your <map> should be nested inside your <object>, e.g. like this:


Only if the list is meant to appear as an alternate to the image map if
the image map can't be rendered. If the goal, as called for by good
accessibility practice, is to provide a list of links somewhere on the
page AND use that list as well to drive the image map, then the map can
be wherever the links ought to appear.
Jan 4 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.