Els wrote:
Mark Tranchant wrote:
On my site, I use a background image of a small arrow to denote links
that lead away from my site. This page has four such links in the
first section:
http://tranchant.plus.com/notes/cable-wrap
The links are coded thus:
<a class="external" href="url">blah</a>
with:
a.external {
background: transparent url('/images/ext') no-repeat 100% 55%;
padding-right: 11px;
}
All works fine, except in IE (surprise) when the image is not shown if
the element either goes across two lines or starts at the beginning of
a line. Load up the above URL in IE and resize the window to see the
effect.
Is this a known IE bug (I expect so) and is there anything I can do
about it (I guess not...)?
Steve's answer gave me the idea to do this:
<a class="external"
href="http://www.fastech.ch/gb/VELCRO/Velcro%20Story.htm">why
I shouldn’t call it velcro<span> </span></a>
and in the stylesheet, change
#content a.external {
background:transparent url('../images/ext.png') no-repeat
100% 55%;
padding-right: 11px;
padding-left:1px;
}
to
#content a.external span{
background:transparent url('../images/ext.png') no-repeat
0% 55%;
}
and
#content a.external:hover {
background:transparent url('../images/exth.png') no-repeat
100% 55%;
background-color: #ffcccc;
}
to
#content a.external:hover {
background-color: #ffcccc;
}
#content a.external:hover span{
background:transparent url('../images/exth.png') no-repeat
100% 55%;
}
I've only tested in IE5 and 6, NS7.1 and Opera 7.5, no
problems with this method, other than
<span> </span> just being ugly code...
--
Els
http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -