login about faq

Due to the large amount of spam accounts, we temporarily disabled new user sign ups. To override this, email newuser.lgqa@gmail.com and an admin will determine if you are permitted to join


I am currently making a website and for the navigation bar I have a series of pictures which act as links and was wondering if there is a way that if a certain page is loaded it shows a diffrent picture for the link depending on the url.

Eg.

the brackets are the links they would go to

home (www.something.com)

pie (www.something.com/pie)

 subpage (www.something.com/pie/1)

 subpage (www.something.com/pie/2)

cheese (www.something.com/cheese)

 subpage (www.something.com/cheese/1)

 subpage (www.something.com/cheese/2)

I would have a picture for each section and if that section (www.something.com/pie) or its subsection (www.something.com/pie/2) was the active page url then a diffrent picture would be displayed.

So, is it possible and if so how would I go about doing it?

asked Feb 09 '11 at 10:34

DomChester's gravatar image

DomChester
391121625

edited Feb 09 '11 at 10:34


There is a way to do that with PHP.. EDIT: I found the way to do it in PHP, here's a tutorial on how to do it, it's fairly simple.

In HTML you're going to have to make the navigation bar and paste it onto each page, then you'll have to change the link's image manually. So, for instance

<a href=#'><img src='home.png' /></a>
<a href=#'><img src='contact.png' /></a>
<a href=#'><img src='about_on.png' /></a>

If you're on the about page you change the image so that it's highlighted or whatever you want to do with it. :)

answered Feb 09 '11 at 11:06

Hugo's gravatar image

Hugo
1.7k243151

edited Feb 09 '11 at 11:10

Thanks alot that really helped

(Feb 09 '11 at 15:04) DomChester DomChester's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported


Join Us in the Chat Room

Tags:

×537
×142
×96
×39
×37
×5

Asked: Feb 09 '11 at 10:34

Seen: 1,195 times

Last updated: Feb 09 '11 at 15:06