nicklocke — 2010-08-31T17:17:39-04:00 — #1
I have this CSS:
background: transparent url('/Images/ButtonLeft.png') no-repeat top left;
font: normal 12px Arial;
background: transparent url('/Images/ButtonRight.png') no-repeat top right;
padding: 4px 9px 4px 0;
background-position: bottom left;
background-position: bottom right;
and this HTML:
<a class="LinkButton" href="Whatever"><span>Button Text</span></a>
So, a pretty standard "sliding doors" technique to cater for varying text widths. In Firefox and IE7 (I've not been able to check IE6) it works as expected - if the mouse button is held down anywhere on the button, the image moves as expected.
BUT, in IE8, that only happens if the mouse button is held down on the left side of the button. If it's held over the right side (actually more likely, as it's bigger!) the graphic does not change.
Please can someone spot what I'm doing wrong?
nicklocke — 2010-08-31T18:08:09-04:00 — #2
Thanks for the prompt answer Paul. It does indeed look like I have chanced across that bug.
Why "active" rather than "hover"? Well, my customer wants the button to highlight when the user clicks and not when the user hovers......
paulob — 2010-08-31T17:38:51-04:00 — #3
It looks like its related to this bug. There doesn't seem to be a solution either apart from using :focus (just for ie8) instead of :active but of course that leaves the element highlighted until focus is removed.
Why don't you just change it to work on :hover instead of on :active.