Reputation: 3
I'm making a navigation bar for my website. The navigation bar is a picture, and I'm wondering if in CSS you can section off parts of the image to link to different pages. Is this possible? If so, how?
The map tag suggestion worked perfectly. Thanks!
Upvotes: 0
Views: 3287
Reputation:
You can use an html MAP tag, see http://www.w3.org/wiki/HTML/Elements/map
Upvotes: 1
Reputation: 359776
Two different ways to do what you want:
Use proper HTML markup+CSS sprites, something like:
<ul class="nav">
<li><a href="foo">Foo</a></li>
<li><a href="bar">Bar</a></li>
<li><a href="baz">Baz</a></li>
</ul>
and combine this with CSS background-position
.
Upvotes: 2
Reputation: 173
You Should try CSS image sprites http://stylemeltdown.com/2007/10/22/image-sprite-navigation-with-css/ for your navigation. Or you could use an image map, but I think the CSS sprites are a more modern and standard way to do this.
Upvotes: 1