View Full Version : Help coding XHTML image map
rhianoran
10-21-2006, 03:22 AM
I've just started teaching myself some xhtml and am getting hosted so I thought for my new site I would use it.
I know how to make image maps but when I sent the file to my boyfriend he tried it on both FF and IE and said in both it didn't show. Probably because I only used the regular HTML way to do it, right?
<img src="http://i90.photobucket.com/albums/k265/rhianoran/alilbit/head
er.gif" border=0 usemap="#mymap">
<map name="mymap">
<area shape=rect coords="44,16,112,84"
href="">
<area shape=rect coords="78,157,140,224"
href="">
<area shape=rect coords="281,125,344,191"
href="">
</map>
Regular map, no links yet of course. Now I did look at W3 and read something about id or whatever...W3 is confusing...
So please help, I'm kind of hoping to get this done by the end of the weekend.
Thanks in advanced!
-Rhian
mwinter
10-21-2006, 11:48 AM
I've just started teaching myself some xhtml and am getting hosted so I thought for my new site I would use it.
There is only an advantage in using XHTML if it will be processed as an application of XML. That is, using an XML processor. MSIE doesn't support XHTML in this fashion, so serving XHTML to clients is pointless. Stick to HTML 4.01, preferably the Strict document type.
XHTML can be useful server-side, but output should be transformed into HTML before returning a response to the client.
There isn't much to learn with regard to XHTML. There are relatively few differences between HTML and XHTML 1.x. The most important thing is to have a thorough understanding of XML.
Mike
rhianoran
10-21-2006, 03:27 PM
Well I'm using it mostly it seems because I'm a dork...lol
But like..dorky question - If I don't use XHTML is using stuff like <br /> gonna work the same way? Cuz <br> doesn't like make as big as a gap as the <br />...lol...
That is purely a style decision. You can alter the <br> element with CSS just like any other element.
rhianoran
10-21-2006, 06:47 PM
OK I've made it so I'm not using XHTML anymore thanks everyone...but now I'm having more problems with Firefox since I downloaded it and looked for myself - the main div is smaller than in IE and I don't know how to fix it. I guess I should probably make a new thread for this problem but if someone would quickly help me out here, this is my stylesheet right now:
<style type="text/css">
body
{background-color: #00688B;
font-family: arial;
font-size: 12px;
font-color: ;
margin: 0px;
padding: 0px;
}
a:link, a:active, a:visited
{color: #00B2EE; text-decoration: none; font-weight: bold;}
a:hover
{color:; border-top: 2px dotted; border-bottom: 2px dotted;}
#header
{float: left;
padding: 5px 5px 10px 5px;
margin: 0px 10px 10px 30px;
background-color: transparent;
height: 230px;
width: 650px;
}
#content
{float: left;
padding: 5px 5px 10px 5px;
margin: 0px 30px 10px 30px;
background-color: #00BFFF;
border-left: 1px solid;
border-right: 1px solid;
border-top: 1px solid;
border-bottom: 1px solid;
width: 650px;
}
html>body #content
{width: 650px;}
#navigation
{float: left;
padding: 10px;
margin: 0px 0px 0px 10px;
background: transparent;
border: 0px solid;
width: 150px;
}
html>body #content
{width: 120px;}
.head
{font-famlily: arial;
font-size: 16px;
font-weight: bold;
color: #000000;
border: 1px solid;
background-color: #009ACD;
padding: 2px;
margin: 0px;}
</style>
What's probably happening is the famous IE expanding-elements bug: instead of respecting the element's dimensions, IE will expand the element to fit its content. You shouldn't be using absolute units anyway, though.
rhianoran
10-21-2006, 08:14 PM
Thanks again ^^ I got it fixed! *glee*
mwinter
10-22-2006, 01:39 PM
If I don't use XHTML is using stuff like <br /> gonna work the same way? Cuz <br> doesn't like make as big as a gap as the <br />
The br element isn't meant to make a gap. It's sole purpose is to interrupt a single line of in-line content; to force content that follows on to a separate line. Two or more consecutive br elements is almost a sure sign of improper use, and a new block level element should be introduced, instead. Similarly, using a br element to separate block level elements is incorrect, and should be replaced by margins or padding on one or both of the elements.
Mike
djr33
10-22-2006, 11:25 PM
The original problem may have been not having self closing tags... like:
<area .... /> or <img ... />
But... as has been said, no point in xml anyway.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.