Reply to Change color of links that have a target of the page on which they are found.

Your name:

Reply:


Posted by Rich Bradshaw on 06/20/07 18:57

Hi,

Sorry about the long title - I have a page with a navbar on. I would
like like to make it so that the links that link to the page the user
is on are a different color.

The problem is, that I want to keep the menu in a file so that I can
server side include it, so I don't want to have to change it manually
for each page.

To help explain this, the page looks like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Contact</title>
<link rel="stylesheet" type="text/css" href="styles/style.css"
media="screen" />
</head>

<body>
<div id="wrap">

<?php include("menu.php"); ?>

<div id="column1">

</div>

<div id="column2">

</div>

</div>
</body>
</html>

Where menu.php looks like this:

<div id="navbar">
<ul id="navlist">
<li><a href="weddings.php">home</a></li>
<li><a href="approach.php">our approach</a></li>
<li><a href="products.php">products &amp; services</a></li>
<li><a href="gallery.php">gallery</a></li>
<li><a href="prices.php">prices</a></li>
<li><a href="booking.php">booking</a></li>
<li><a href="contact.php">contact</a></li>
<li><a href="links.php">links</a></li>
</ul>
</div>

Obviously there is some css formatting here as well.

If we are on contact.php, I want the link to contact.php to be styled
differently so that we know where we are.

Is there any way to do this without getting rid of the server side
include or drastically making the site more complex?

Thanks a lot,

Rich

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация