Forum Moderators: not2easy

Message Too Old, No Replies

call image map in css?

how do you do it?

         

Blue_Wizard

12:53 am on Feb 14, 2004 (gmt 0)

10+ Year Member



Have 2 navigation menus that appears on every page of the site that are image maps (one image not sliced- top header image map and a side bar)

It's custom text and navigation in the image maps that change with each month/season- so I am trying to find an easy way to switch the image maps globally for both static and dynamic gen pages.

is there a way to call the image map code from the css instead of having it in the actual html document

Rhys

10:05 am on Feb 14, 2004 (gmt 0)

10+ Year Member



Here's a trick to put a menu on every page on the site using a style sheet and html, I use the image as a background in a Div or table, specified in the main css file with a class statement, like

.menu { background-image: url("bgr.jpg"); }

then in the menu code - use <div class="menu">

This allows a site-wide change with only one file to edit.

Another useful trick I use here is to put the whole menu code in as a Javascript include - this is a sneaky way of using includes without shtml or php, etc.- E.G.

Put this code in a file called menu.js
document.write(" <p align=center> <a href='link1.htm'>Link1</a><br><a href='link2.htm'>Link2</a> </p>");

and call on it every page that needs a menu with this tiny bit of html -
<SCRIPT LANGUAGE="JavaScript" src="menu.js"> </SCRIPT>

All you need to do each month is update the file called bgr.jpg and the whole site is edited.