CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 23rd, 2004, 03:32 PM
sanantonerose sanantonerose is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 4 sanantonerose User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Image Maps in CSS?

Hello. I'm a first time poster and also still wet behind the ears as far as CSS goes. I would like to know if there is a way to insert image map coordinates into a style sheet so I do not have to repeat those image map coordinates on each html page.

Here's my sample that I'm working with:

URL

So I have one image (which I know I have to put on the html page, because CSS only allows background images), and then all these hotspots on the image that form the map + coordinates.

If there is a way to put all those coordinates over into an external style sheet, I'll be ... ecstatic. If there's not a way, then I'll abandon this idea and move on!

Much thanks in advance,
san antone rose

Reply With Quote
  #2  
Old July 23rd, 2004, 09:00 PM
NotGoddess's Avatar
NotGoddess NotGoddess is offline
Kung-fu Kitty
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 350 NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 6 h 9 m 2 sec
Reputation Power: 10
Send a message via AIM to NotGoddess
CSS Image Maps

Once again, a list apart comes to the rescue.
http://www.alistapart.com/articles/imagemap/

You can have CSS imagemaps by having defined areas which are links of fixed size. This shows a quick setup (background represents image, and borders outline link areas), which I tested in Mozilla 0.8, IE6, and Opera 7.

PHP Code:
<div id="myimagemap" style="background:aliceblue; height:200px; width:200px;">
   <
a href="#a" id="maplink1"
    
style="float:left; height:100px; width:50px; border:1px green solid;"></a>
   <
a href="#b" id="maplink2"
    
style="float:left; height:50px; width:100px; border:1px blue solid;"></a>  
</
div

Last edited by NotGoddess : July 23rd, 2004 at 09:03 PM. Reason: Obsessive need for text to line up properly.

Reply With Quote
  #3  
Old July 26th, 2004, 11:07 AM
sanantonerose sanantonerose is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 4 sanantonerose User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks!

Thanks! That's a great article in A List Apart. I'm guessing then that I could put my image map elements into the style sheet, then link to my javascript rollovers from the style sheet? Or would I be relying too much on externals?

I'm trying to find a balance between coding on html pages v. using external controls (where things can be easily changed) v. accessibility issues.

Would anyone else out there recommend using the css image map technique?

Thanks so much.
san antone rose

Reply With Quote
  #4  
Old July 26th, 2004, 01:22 PM
kk5st's Avatar
kk5st kk5st is offline
Thanks Johnny Hart (BC) R.I.P.
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: May 2003
Location: Dallas
Posts: 4,674 kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Month 3 Days 15 h 15 m 50 sec
Reputation Power: 687
Generally, from an accessibility angle, image maps are not a Good Thing™. Mobility impaired folks might have difficulty with a mouse, so you must make tabbed focus very obvious. Visually impaired folks, using most assistive technology UAs, will "see" a linearized version of your page. The image map will be seen as a link to the image map links. Look at your page in Lynx for an idea of what's happening.

My own philosophy is that no essential functionality should depend on client side scripting, images, css, or plug-ins. You can put tartar sauce on the fish, but the fish had better be edible without it.

cheers,

gary
__________________
There are those who manage to build a web site without knowing what they're doing; thereby proving to themselves they do, indeed, know what they're doing.

My html and css workshop, demos and tutorials.
Ask a better question, get a better answer.

Reply With Quote
  #5  
Old July 26th, 2004, 08:29 PM
NotGoddess's Avatar
NotGoddess NotGoddess is offline
Kung-fu Kitty
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 350 NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 6 h 9 m 2 sec
Reputation Power: 10
Send a message via AIM to NotGoddess
Quote:
Originally Posted by kk5st
Generally, from an accessibility angle, image maps are not a Good Thing™.
I agree, but would also propose that this is a reason to promote the use of CSS-based imagemaps over traditional HTML-only versions. Since they are made up of normal anchor tags with a simple div around them they are processed by accessibility devices without any need for special code. If you are wishing to use an imagemap on your site, this is a better way to go.

Quote:
Originally Posted by kk5st
Look at your page in Lynx for an idea of what's happening.
If you use an anchor tag without content, Lynx just won't show them. I try to have 'plain text' links at the bottom of my pages, regardless of the styling of the top links.

(Hint: There are Lynx browsers that will run on Windows, but if you don't have easy access, then use FireFox/Mozilla and view pages with no styling.)

Quote:
Originally Posted by kk5st
My own philosophy is that no essential functionality should depend on client side scripting, images, css, or plug-ins. You can put tartar sauce on the fish, but the fish had better be edible without it.
I do agree with this. Nothing annoys me more than a site that requires java/activeX, javascript, and images in order to view/navigate it. Everything should always degrade gracefully when stripped of the 'fluff'. But fluff is nice to add when you have all that.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > Image Maps in CSS?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT