This is pretty easy with keyframe animation.
Unfortunately, only Firefox supports animation of pseudo-elements at the moment, but here is an example of the effect.
.
:
a {
display:block;
height:50px; width:50px;
position:relative;}
a:after,a:before{
content:'';
width:5px; height:5px;
display:block;
position:absolute;
-moz-animation: autocast 2s infinite;
background:black;
}
@-moz-keyframes autocast {
0% {top:0; left:0;}
25% {top:0; left:45px;}
50% {top:45px; left:45px;}
75% {top:45px; left:0;}
100% {top:0; left:0;}
}
a:before{ -moz-animation-delay: 1s;}
box-shadows, .