Links not displaying correctly

First post so heres hoping for some insight into this problem or am I just being thick!!

a:link { color: #0033FF } /* unvisited link /
a:visited { color: #0066CC } /
visited links /
a:hover { color: #0099FF } /
hover on link /
a:active { color: #33CC33 } /
active links */

Using the above CSS I used PHP to produce the following to create a link to another page in a table cell. Ignore the colors for now.

<td><a href=“http://www.metoffice.gov.uk/weather/uk/se/barking_forecast_weather.html” target=“_blank”><img class=“noimageborder” src=“images/weathericon.gif”
alt=“Weather for Redbridge”/></a></td>

Before any links are visited visited color (#0066CC) is used for the default (link) color.

Any ideas why this should be anybody?

Thanks

Some browsers look at whether you’ve visited that page before and so change all the links to visited, some look at whether you’ve visited that anchor before and so only change the link you’ve clicked on to visited.

The only way I can think of to resolve the issue is to add an irrelevant query onto the end of the filename (but before the bookmark, eg

<li><a href="page.htm?s=1#section1">Link 1</a></li>
<li><a href="page.htm?s=2#section2">Link 2</a></li>

If your server hasn’t been told to do anything with the query then it will just ignore it and serve the page as normal, but as far as the browser is concerned, page.htm?s=1 is different from page.htm?s=2 so would colour the links individually. However, this may have other consequences that I can’t think of at the moment.

The link code posted was incorrect for this issue. The link posted is to a weather site. The idea behid this was that the user did not leave my site. I have seen this (target = “_blank”) suggested as a good idea.

Using target="_blank" is not recommended. Trying to keep users on your site is a bad strategy. There are several reason why target=“_blank” is a bad idea.

The first is that it should be the user’s choice. If they want to open a link in a new window, every browser gives them the option to do so. If they don’t want to open a link in a new window, Opera is the only mainstream browser that allows them to override target=“_blank”, so 99% of people simply can’t make that decision.

The second reason is that there is no point - everyone knows how to use the ‘back’ button, so if they’ve navigated away from your site and want to return to it, they can do so. Keeping a window open on your site in the background isn’t going to help your business.

The third is that, with most browsers now operating both windows and tabs, the behaviour of target=“_blank” is unpredictable. Some browsers automatically open it in a new window, whereas most users would prefer it to open in a new tab within the existing window. If you give them the choice, they can decide that for themselves. If you force it on them, you’re taking away their chance to surf the web in the way that they want to.

The fourth is that it has accessibility and usability problems, particularly for people who are not using a standard desktop PC setup with keyboard and mouse.

The site will provide lists of cycle riders who have arrived at various towns on an enduurance bike ride. Other info such as distances, dates and times, average speed and time in hand will all be displayed in the table. The data is in a database and users are offered a number of selection criteria.

In that case, a table is probably an appropriate way to set it out!

Thanks Stevie for your time.

Re:

<li><a href=“page.htm?s=1#section1”>Link 1</a></li>
<li><a href=“page.htm?s=2#section2”>Link 2</a></li>

I will look at this tomorrow as I have not added queries to filenames yet
but am looking forward to it. I’m not sure of the consequences but cannot imagine there are any as the s=1, s=2 etc could easily be used in the loaded page. More research I fear!!

The tables will stay as the rider data is suited to them.

This is all new to me but I am learning fast thanks to help I am getting.

Justin

So… irrespective of where the page in the link was visited from, the link will appear as visited even if the link has not been clicked on. I understand that now.

The link will take the user to a bookmark on another page so when one link is clicked on, every link to that page will change color. Is there a way to do this so that only the link clicked on changes color?

The link code posted was incorrect for this issue. The link posted is to a weather site. The idea behid this was that the user did not leave my site. I have seen this (target = “_blank”) suggested as a good idea.

The site will provide lists of cycle riders who have arrived at various towns on an enduurance bike ride. Other info such as distances, dates and times, average speed and time in hand will all be displayed in the table. The data is in a database and users are offered a number of selection criteria.

Do you still think that a table is not appropriate? I am open to ideas.

Thanks

“Visited” means that you have been to that page, not that you have clicked on the link. If the page at the other end of the link appears in your browser’s history, it will show the link as “visited”. To check out what’s really happening, set up a link to a page that you’ve never been to, maybe even a page that doesn’t exist, just make up a random URL for the anchor, and see what colour the link text is then.

Off Topic:

Apart from that, if you want general advice, (a) using target=“_blank” is not good practice, and (b) is that really something that needs to be in a table cell? Maybe a table is the right way to go, but a lot of the time, tables are used where they shouldn’t be…