Forum Moderators: not2easy

Message Too Old, No Replies

a:visited - Could you be using CSS and :pseudo classes as a Marketing Tool?

or alternatively just as an extra visibility/usability aid.

         

SuzyUK

11:45 am on Jul 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



We all know you can use CSS to style the various <a>nchor (link) states, this is most commonly used in navigation "menus". The use of different colors and "strike-through" to show whether a link has been visited or not is considered a usability "plus". Jakob Neilson recommends [useit.com] it and it has now come a long way since the blue/purple defaults.

The W3C Guidelines recommend [w3.org] that you don't rely on colour alone. In the visual browsing arena the increasing use of background images throws up the possibility of neat visual navigational aids, a visit around some of the CSS Menu tutorials or the CSSzengarden will demonstrate this.

But wait is there another way to use a:visited!
Here's a theory on how it could be used as a Marketing Tool

Setting the Scene


<!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>
<title>Untitled</title>
<style type="text/css" media="screen">
html, body {margin: 0; padding: 0; border: 0;}
body {
margin: 60px;
border: 3px double #008;
padding: 40px;
text-align: center;
}

#demo a {display : none;}

#demo a span {
position : absolute;
left : -1000px;
width : 200px;
}

#demo a:visited {
cursor : default;
display : block;
width : 210px;
height : 80px;
}

#demo a#wmw:visited {
background: url(http://showcase.netins.net/web/phdss/wmwgfx/dlogo.png) no-repeat 50% 50%;
}

#demo a#cnn:visited {
background: url(http://i.cnn.net/cnn/.element/img/1.1/logo/logo.gif) no-repeat 50% 50%;
}

</style>
<script language="JavaScript" type="text/javascript">
var statusmsg=""
function hidestatus() {
window.status=statusmsg
return true
}
</script>
</head>
<body>
<p>Have you visited these pages?</p>
<ul>
<li><a href="http://www.webmasterworld.com/" title="Webmaster World"><span>WebmasterWorld</span></a></li>
<li><a href="http://www.cnn.com/" title="CNN News"><span>CNN.com</span></a></li>
</ul>

<div id="demo">
<p>If you have, their Logos will appear below here</p>
<hr />
<a href="http://www.webmasterworld.com/" id="wmw" onmouseover="return hidestatus()" title="Webmaster World"><span>WebmasterWorld</span></a>
<a href="http://www.cnn.com/" id="cnn" onmouseover="return hidestatus()" title="CNN News"><span>CNN.com</span></a>
</div>

</body>
</html>

The CSS - Step By Step

  • set up the <a>nchors, using a unique id for each.
  • hide the <a>nchor with display:none;
  • Use the span to position the link text value off the screen, so only the background image is left showing.
  • Add some formatting for the all
    a:visited
    link states.
  • To hide the fact that an image is actually a link, change the default cursor to a pointer instead of the "hand". cursor: default;
  • Bring the display back by adding display: block;
  • Specify the width and height to suit your chosen images.
  • Note: The Javascript (in the head) stops the URL from appearing in the status bar on hover, again disguising the fact that the image is a link.
  • Add a different background image for each different visited link. background: url(your.gif) no-repeat 50% 50%;

Now you're done..

Thoughts...
The reaches of this are certainly interesting, What's your thoughts on using this, for or against, possibilities, implications?

Suzy

edit grammar, speeling as usual! :)

[edited by: SuzyUK at 8:36 pm (utc) on July 24, 2004]

iamlost

7:55 pm on Jul 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Will have to think this through - as usual you make my head hurt!

Two notes:
One: the link to WebmasterWorld logo is displayed incorrectly - the auto expansion of three little letters to WebmasterWorld breaks it.

<query>Just how can you post those letters without expansion?</query>

Two: possible copyright concerns if using logo without written permission.

Great idea - will take two aspirin and get back to you!

SuzyUK

6:11 pm on Jul 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi iamlost..

sorry didn't mean to give you a headache or to suggest copyright infringement, I only used those two as general examples.. ;)
disclaimer ~ host your own images

more so even craft your own images?

example
Set up the links to your competitors, add your own crafted images ** to go with them and there may be some possibilities..
**e.g. We sell our Widgets cheaper than <competitor>

i.e. if your visitor has already been at one of your designated competitors sites you could give them a "tailored" message in the form of an image...?

Suzy

encyclo

6:35 pm on Jul 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've seen this idea floating around (I've lost the original source, as is usual with me - note that the code below is not my invention).

Step 1:

A link to your competitor's site, perhaps in a block styled with

display:none;
. Identify with an id attribute:

<a id="competitor" href="http://www.example.com/">My Competitor</a>

Step 2:

Set the styles:

a {color:blue;} 
a:visited {color:red;}

Step 3:

A smattering of Javascript:

if (document.getElementById('competitor').currentStyle.color=='red') 
document.writeln('<h2>Hey you!<\/h2>');
document.writeln('<p>Don\'t buy from example.com because they');
document.writeln('are a bunch of crooks!<\/p>');

As usual, YMMV...

SuzyUK

10:55 am on Jul 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



.. never thought about using it with Javascript too..

might also be a nice way to use it in reverse too to "feature" more recent topics/news that a visitor hadn't yet read/visited..

Suzy