whats the best way to make a pdf download have a icon so there isn't a link but a icon to click?
you can do that quite easy with css, no need for anything fancy like a block or something like that..
To be more precise
a[href$=".pdf"] {
background: url(path/to/pdf.gif) no-repeat scroll 0 50%;padding-left: 18px;
}
Does not work in IE6, but who cares.
a[href$=".pdf"] {
background: url(path/to/pdf.gif) no-repeat scroll 0 50%;padding-left: 18px;
}
Does not work in IE6, but who cares.
thanks, let's finish that css tutorial with a little ie6 addon ;-)
$('a[href$=".pdf"]').css({ paddingLeft: '18px', background: 'url(path/to/pdf.gif) no-repeat scroll 0 50%' });
Great tip.
jquery rocks! Swiss army knife for developers. No pun intended ;-)
jquery rocks! Swiss army knife for developers. No pun intended ;-)
thanks a ton guys! I will try this out!
It worked but when I add a file in my tiny mce editor is displays the file name and a part of the icon.
Example is in the attachment...
Is there anyway to get rid of the file name?
This is my current CSS:
a[href$=".pdf"] {
background: url(images/PDF-Icon.jpg) no-repeat scroll 0 50%;padding-left: 18px;
width: 150px;
height: 150px;
}
Any help would be very appreciated!
Example is in the attachment...
Is there anyway to get rid of the file name?
This is my current CSS:
a[href$=".pdf"] {
background: url(images/PDF-Icon.jpg) no-repeat scroll 0 50%;padding-left: 18px;
width: 150px;
height: 150px;
}
Any help would be very appreciated!
You can set a fixed width equal to the image width and hide the rest.
display: block; width: 18px; overflow: hidden;
But I'm not sure how this is interpreted by tinymce. I guess you have to experiment a bit.
display: block; width: 18px; overflow: hidden;
But I'm not sure how this is interpreted by tinymce. I guess you have to experiment a bit.
But, the file name is still there is there any way to get rid of this?
you could try:
text-indent: -999px;
But from that point on you are entering advanced css techniques :-S
OR alternatively use a HTML img-tag.
text-indent: -999px;
But from that point on you are entering advanced css techniques :-S
OR alternatively use a HTML img-tag.
It makes the boss happy so if he is happy I am happy! Thanks a ton! You helped out a great deal!