aspose file tools
The moose likes HTML, CSS and JavaScript and the fly likes how to use html tag <area> if the image is background image Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "how to use html tag <area> if the image is background image" Watch "how to use html tag <area> if the image is background image" New topic
Author

how to use html tag <area> if the image is background image

david arnold
Ranch Hand

Joined: Apr 10, 2009
Posts: 133
Hi,

I have a background image on jsp login page which defined in css


Now I want part of the area of the image could be clicked, and I found this <area> tag which works fine together with <img> tag. Example:



But my problem is that the image work as background, even if I put it in jsp file instead of css, it will be like
, if I could not define the <img> tag, then I could not use <map> tag to associate with the <img>tag, right? Then I could not define the <area> tag.

Thanks for the help.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61985
    
  67

No can do. A background is just a background. If you want it to be clickable, don't make it a background.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
david arnold
Ranch Hand

Joined: Apr 10, 2009
Posts: 133
I see. Thank you Bear for the info.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61985
    
  67

If you need layered elements you could investigate using absolute and relative positioning to place an image element behind other elements.
 
Don't get me started about those stupid light bulbs.
 
subject: how to use html tag <area> if the image is background image