Because the span
s are forced into block
display (by virtue of having given them float
properties), you need to make sure the a
also has block
display and either overflow: hidden
OR clearfix such that it is certain to completely contain the space (and intervening space) occupied by its contents:
a {
display: block;
*zoom: 1;
}
a:after {
clear: both;
content: " ";
display: table;
}
.span1 {
float: left;
}
.span2 {
float: right;
}
EDIT: based on reported weirdness in IE7:
*+html a * {
cursor: pointer;
}