Schmoopy
12-04-2008, 09:33 PM
Hi there, I have an image map, but I want to somehow style it in CSS so that as I add more hotspots, they will each have their own background-image. I've searched around but haven't found anything, is it possible?
Here is the code I currently have for the map:
<img src="images/map/ukcentres3.png" alt="UK" usemap="#map" style="border:none; z-index:0;"/>
<map name="map" id="map">
<area shape="circle" coords="169,659,9" href="#" alt="Ivyleaf Mountainboarding Centre" title="Ivyleaf Mountainboarding Centre"/>
<area shape="circle" coords="187,648,9" href="#" alt="South West Mountainboard Centre" title="South West Mountainboard Centre"/>
<area shape="circle" coords="238,639,8" href="#" alt="Ride The Hill (Quantock)" title="Ride The Hill (Quantock)"/>
<area shape="circle" coords="347,646,8" href="#" alt="Haredown" title="Haredown"/>
<area shape="circle" coords="388,644,8" href="#" alt="Knockhill Mountainboard Centre" title="Knockhill Mountainboard Centre"/>
<area shape="circle" coords="173,258,9" href="#" alt="Air Fusion" title="Air Fusion"/>
<area shape="circle" coords="375,616,8" href="#" alt="Ride The Hill (XBP)" title="Ride The Hill (XBP)"/>
<area shape="circle" coords="350,609,8" href="#" alt="Oakwood Youth Challenge" title="Oakwood Youth Challenge"/>
<area shape="circle" coords="333,598,8" href="#" alt="The Waterside Centre" title="The Waterside Centre"/>
<area shape="circle" coords="177,292,8" href="#" alt="Newmilns Ski and Board Centre" title="Newmilns Ski and Board Centre"/>
<area shape="circle" coords="250,478,8" href="#" alt="Hale Superbole" title="Hale Superbole"/>
<area shape="circle" coords="248,515,10" href="#" alt="The Edge" title="The Edge"/>
<area shape="circle" coords="247,545,8" href="#" alt="Court Farm" title="Court Farm"/>
<area shape="circle" coords="256,575,8" href="#" alt="Red Hill Extreme" title="Red Hill Extreme"/>
<area shape="circle" coords="266,554,7" href="#" alt="Out To Grass" title="Out To Grass"/>
<area shape="circle" coords="287,563,8" href="#" alt="Bugsboarding" title="Bugsboarding"/>
<area shape="circle" coords="253,393,8" href="#" alt="Surf The Turf" title="Surf The Turf"/>
<area shape="circle" coords="129,707,9" href="#" alt="Xtreme Academy" title="Xtreme Academy"/>
<area shape="circle" coords="147,581,9" href="#" alt="Wild West Mountain Boarding" title="Wild West Mountain Boarding"/>
<area shape="circle" coords="199,515,9" href="#" alt="The Dragon Run" title="The Dragon Run"/>
<area shape="circle" coords="102,390,9" href="#" alt="Surfin' Dirt" title="Surfin' Dirt"/>
<area shape="circle" coords="288,429,9" href="#" alt="Another World MBC" title="Another World MBC"/>
<area shape="circle" coords="397,579,8" href="#" alt="Stubbers Activity Centre" title="Stubbers Activiy Centre"/>
<area shape="circle" coords="314,629,10" href="#" alt="Ride The Hill (Deptford Downs)" title="Ride The Hill (Deptford Downs)"/>
<area shape="circle" coords="261,663,10" href="#" alt="Coastal Mountain Boarding Centre" title="Coastal Mountain Boarding Centre"/>
<area shape="circle" coords="210,572,8" href="#" alt="Greenman MBC" title="Greenman MBC"/>
<area shape="circle" coords="300,475,9" href="#" alt="Ride The Hill (KMC)" title="Ride The Hill (KMC)"/>
</map>
</div>
I've already tried styling it like "#map area{ background:url(images/image.jpg) no-repeat; }" but no luck as of yet =/.
So instead of having to make a new image every time I want to add a new hotspot, there would be a background image already there, making it much simpler. Here is a link to the page so you can see what I mean:
http://www.bombthehills.com/ridingspots-uk.html
Thanks in advance,
Jack.
Here is the code I currently have for the map:
<img src="images/map/ukcentres3.png" alt="UK" usemap="#map" style="border:none; z-index:0;"/>
<map name="map" id="map">
<area shape="circle" coords="169,659,9" href="#" alt="Ivyleaf Mountainboarding Centre" title="Ivyleaf Mountainboarding Centre"/>
<area shape="circle" coords="187,648,9" href="#" alt="South West Mountainboard Centre" title="South West Mountainboard Centre"/>
<area shape="circle" coords="238,639,8" href="#" alt="Ride The Hill (Quantock)" title="Ride The Hill (Quantock)"/>
<area shape="circle" coords="347,646,8" href="#" alt="Haredown" title="Haredown"/>
<area shape="circle" coords="388,644,8" href="#" alt="Knockhill Mountainboard Centre" title="Knockhill Mountainboard Centre"/>
<area shape="circle" coords="173,258,9" href="#" alt="Air Fusion" title="Air Fusion"/>
<area shape="circle" coords="375,616,8" href="#" alt="Ride The Hill (XBP)" title="Ride The Hill (XBP)"/>
<area shape="circle" coords="350,609,8" href="#" alt="Oakwood Youth Challenge" title="Oakwood Youth Challenge"/>
<area shape="circle" coords="333,598,8" href="#" alt="The Waterside Centre" title="The Waterside Centre"/>
<area shape="circle" coords="177,292,8" href="#" alt="Newmilns Ski and Board Centre" title="Newmilns Ski and Board Centre"/>
<area shape="circle" coords="250,478,8" href="#" alt="Hale Superbole" title="Hale Superbole"/>
<area shape="circle" coords="248,515,10" href="#" alt="The Edge" title="The Edge"/>
<area shape="circle" coords="247,545,8" href="#" alt="Court Farm" title="Court Farm"/>
<area shape="circle" coords="256,575,8" href="#" alt="Red Hill Extreme" title="Red Hill Extreme"/>
<area shape="circle" coords="266,554,7" href="#" alt="Out To Grass" title="Out To Grass"/>
<area shape="circle" coords="287,563,8" href="#" alt="Bugsboarding" title="Bugsboarding"/>
<area shape="circle" coords="253,393,8" href="#" alt="Surf The Turf" title="Surf The Turf"/>
<area shape="circle" coords="129,707,9" href="#" alt="Xtreme Academy" title="Xtreme Academy"/>
<area shape="circle" coords="147,581,9" href="#" alt="Wild West Mountain Boarding" title="Wild West Mountain Boarding"/>
<area shape="circle" coords="199,515,9" href="#" alt="The Dragon Run" title="The Dragon Run"/>
<area shape="circle" coords="102,390,9" href="#" alt="Surfin' Dirt" title="Surfin' Dirt"/>
<area shape="circle" coords="288,429,9" href="#" alt="Another World MBC" title="Another World MBC"/>
<area shape="circle" coords="397,579,8" href="#" alt="Stubbers Activity Centre" title="Stubbers Activiy Centre"/>
<area shape="circle" coords="314,629,10" href="#" alt="Ride The Hill (Deptford Downs)" title="Ride The Hill (Deptford Downs)"/>
<area shape="circle" coords="261,663,10" href="#" alt="Coastal Mountain Boarding Centre" title="Coastal Mountain Boarding Centre"/>
<area shape="circle" coords="210,572,8" href="#" alt="Greenman MBC" title="Greenman MBC"/>
<area shape="circle" coords="300,475,9" href="#" alt="Ride The Hill (KMC)" title="Ride The Hill (KMC)"/>
</map>
</div>
I've already tried styling it like "#map area{ background:url(images/image.jpg) no-repeat; }" but no luck as of yet =/.
So instead of having to make a new image every time I want to add a new hotspot, there would be a background image already there, making it much simpler. Here is a link to the page so you can see what I mean:
http://www.bombthehills.com/ridingspots-uk.html
Thanks in advance,
Jack.