Archive for September, 2005

Usercontent and CSS3 selectors

Wednesday, September 7th, 2005

In CSS 3 there is a several new attribute selectors. Especially interesting is the “Substring matching attribute selectors

Represents the att attribute whose value ends with the
suffix “val”

Both Mozilla and Safari has implemented support for this css3 property. Though it might be a bit early use to on the net considering the limit browser support for this. You can use it to enchant your own suring experience.

One of the great irritations I find on the net, is that no one denotes what they link to. Is it a normal link or is it a link to a document that either requires plugins or that you have to download to read, like links to pdf-documents.

So what I did was to add a simple line in the userContent.css file in mozilla.

a[href$=".pdf"]:after {
content:url(pdf.gif) !important; /* one might have to use a explicit url */
padding-left:0.5em !important;

There are several possibilities one how you can mark such links. I’ve made some examples that you can see here or in the screenshot below.

Screenshot:pdf icons

And you can do this to any kind of documents. Just add more lines in the userContent for suffixes like .doc, .xls, .mp3, .mov, wma etc. Endless posibilities. Granted some sites serve content without the file suffix. But this should probably work on most of the cases.