3 replies [Last post]
laurenced
Offline
Last seen: 4 years 3 weeks ago
newbie
Timezone: GMT+1
Joined: 2007-09-05
Posts: 5
Points: 0

Hello all

I have this CSS which applies little "mime" icons to PDF and Word links:

a.pdf:link {
color:#058; 
background-image:url(../images/pdf.gif); 
background-repeat:no-repeat; 
background-position:center left; 
padding-left:18px
}

and obviously I apply the class to links with class="pdf". However, it doesn't work on all links in FF and some in IE. There appeared to be a bug where it wouldn't work when the link was wrapped between two lines, which I can live with, but in many cases it is now not showing at all.

You can see what I mean here:

http://www.scotlawcom.gov.uk

(see the news panel on the right - the links near the top don't have the icons while the ones near the bottom do. You can see if you hover which ones should have them - i.e. the PDFs.)

Elsewhere in the site they seem to work fine, but I can't understand what is going wrong here, since they should presumably always work or not work at all.

Any help would be much appreciated Smile

laurenced
Offline
Last seen: 4 years 3 weeks ago
newbie
Timezone: GMT+1
Joined: 2007-09-05
Posts: 5
Points: 0

Sorry, I was really dumb and

Sorry, I was really dumb and didn't specify visited/active etc styles for the links, so they weren't displaying on my machine because I'd tested the links.

Dumb mistake but fixed now Smile

Hugo
Hugo's picture
Offline
Last seen: 4 hours 41 min ago
Moderator
London
Timezone: GMT+1
Joined: 2004-06-06
Posts: 15615
Points: 2750

We've all done it

We've all done it Smile

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

laurenced
Offline
Last seen: 4 years 3 weeks ago
newbie
Timezone: GMT+1
Joined: 2007-09-05
Posts: 5
Points: 0

laurenced wrote:Sorry, I was

laurenced wrote:

Sorry, I was really dumb and didn't specify visited/active etc styles for the links, so they weren't displaying on my machine because I'd tested the links.

Dumb mistake but fixed now Smile

Actually there is still a problem. If the link wraps over a line, in IE the icon doesn't show and I have to manually add the icon as an image before the link (which is very inelegant).

It's not really practical to check all the links on a site to ensure they don't wrap over two lines and then to insert the image.

Is there a fix for this?