Jump to content

Automatic link icons


Recommended Posts

Is there any way, using regular HTML, CSS, PHP or JavaScript to have a webpage automatically insert a certain corresponding icon before a link to a file that is not HTML, PHP or something else that is "regular" for the browser? I want to be able to let people know that the link is to PDF or PowerPoint or something like that, and I don't want to have to insert

<img src="/icons/pdf.png" width="16" height="16" alt="PDF document" />

or something like that before every link to a certain file. Also it would be nice to be able to do something like what wikipedia does where if a link is external, it shows a little arrow next to it and is a slightly different color. Anyone know of a way to do this? This would be going on PHP pages, but any method with CSS or JavaScript or PHP or just plain old (X)HTML would work.

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...