Log in

View Full Version : how to do link always coloured for particular page?



toplisek
03-09-2007, 11:48 AM
1. question: I would like to do that when user clicks on link it will be constant with particular colour. How to do it because there is removed A:active as I do not want to show all the time coloured if user clicks on link. It should be just in case user is on particular page.
2. question:
I would like to give this menu separate css script name like topmenu. How to do it that all css will be not for all page?

I'm new to this. Need help



<head>
<title></title>
<style type="text/css">

A:link
{
font-family: "Helvetica Neue Light", Helvetica, Arial, sans-serif;
text-decoration:none;
background-color:#000000;
color:#ffffff;
text-align:center;
font-size:16px;
font-weight:bold;
font-style:normal;
text-decoration:none;
}

A:visited
{
font-family: "Helvetica Neue Light", Helvetica, Arial, sans-serif;
text-decoration:none;
background-color:#000000;
color:#ff6600;
text-align:center;
font-size:16px;
font-weight:bold;
font-style:normal;
text-decoration:none;

}
/*
A:active
{
font-family: "Helvetica Neue Light", Helvetica, Arial, sans-serif;
text-decoration:none;
background-color:#000000;
color:#ffffff;
text-align:center;
font-size:16px;
font-weight:bold;
font-style:normal;
text-decoration:none;
}
*/
A:hover
{
font-family: "Helvetica Neue Light", Helvetica, Arial, sans-serif;
text-decoration:none;
background-color:#000000;
color:#ff6600;
text-align:center;
font-size:16px;
font-weight:bold;
font-style:normal;
text-decoration:none;
}
-->
</style>

</style>
</head>

<body>


<table border="0" cellpadding="0" cellspacing="0" width="480">
<tr>

<td align="middle" width="120">
<A href="link.htm">Link</A></td>

<td align="middle" width="120">
<A href="link1.htm">Link1</A></td>

<td align="middle" width="120">
<A href="link2.htm">Link2</A></td>

<td align="middle" width="120">
<A href="link3.htm">Link3</A></td>
</tr>
</table>

</body>

</html>

chechu
03-09-2007, 12:17 PM
Q1: if I understand well:

It should be just in case user is on particular page
then you could just change the color of that link using <font>. Then people know when they are on a certain page because that link is colored. Css has nothing to do with it.
Q2: again, if I understand well:

How to do it that all css will be not for all page
Best you can do is place the css that is applicated to all pages in a separate css file, referring to it like this:
[CODE]<link href="stylesheet.css" rel="stylesheet" type="text/css">/CODE]
Place the effects you wish to use on specific pages only like in the example above, in the head.
I have problems really understanding what you mean, but I hope this helps.

toplisek
03-09-2007, 12:30 PM
Q1: I have problem that header is seen on all pages. So it can not be solution with font because it is seen on all pages as included file.


Q2:
I have done css for all pages like:
[code]<link href="stylesheet.css" rel="stylesheet" type="text/css">/CODE]

but there is problem that this menu buttons with css should have their own defined names like ID, div...How to do it? Need help as I'm new to this.

chechu
03-09-2007, 12:33 PM
Can you place a link to have a closer look, please ?

toplisek
03-09-2007, 12:35 PM
do not understand. There is all code. I have not on server as it is not solved issue. Please send me question if I wasnot clear. Sorry not to show you web site.

vanbao
03-09-2007, 06:54 PM
I would like to install a menu through css with link tabs like the menu shown here:http://www.dynamicdrive.com/style/csslibrary/item/dd-color-tabs-ii/

My question is. How do I make it so the link tab belonging to the current page gets highlighted. I don't want to manually put the menu code section on each of the pages heads and manually specify id="current" on each page.

Is there a java script or something that will allow me to put the same menu tags on each of the pages head and when a visitor click on a particular page, the script automatically change the link tab linking to that page to a different color.

Twey
03-09-2007, 08:08 PM
then you could just change the color of that link using <font>. Then people know when they are on a certain page because that link is colored. Css has nothing to do with it.Except that <font> is obsolete presentational markup.

toplisek, either include a special CSS file for that page or give the page's <body> an ID and identify it that way.