Fun with Cascading Style Sheet and the rel=”nofollow” tag
I talked about using the rel=”nofollow” tag yesterday, here’s how I know some of you weren’t using it. It’s a simple Cascading Style Sheet trick (css), an this trick is for Firefox Only. I’ve just started schooling myself on CSS but I think the tags are just instructions to your browser on how to render things. Anyway, not important.
If you want to see the rel=”nofollow” tags when you are browsing, all you have to do is drop a few lines in your UserContent.css. If you have a stock install, you probably don’t have that file yet, so you can created it using notepad or something. If you have the file, you can add the lines to your existing file.
This page: http://kb.mozillazine.org/Profile_folder tells me that for most users with MS windows XP or 2k, the file in question should be in:
C:\Documents and Settings\[Windows login/user name]\Application Data\Mozilla\Profiles\[Profile name]\chrome\
for Linux:
/home/[username]/.mozilla/firefox/[profile-name].default/chrome
Mac:
/home/[username]/Library/Mozilla/Profiles/[Profile name]/
I don’t have a Mac or a MS Windows box around to double check this, tell me if I messed up, please.
Again, unless someone has been tuning your install, you probably don’t have a file called UserContent.css yet.
Using notepad or something, create a file called UserContent.css in the proper directory. Add theses two lines to the blank file you created:
/* distinctly shows rel=nofollow links */
a[rel~=nofollow] { color: yellow !important; background: black !important; }
(yup, that’s only 2 lines of code, and one is a comment. If you already had a UserContent.css file, just add those two lines in at the end)
That’s it. Important! Save the file and restart Firefox. This is what it will look like:
(Click on the picture for higher-rez picture (61 KB), as a pop-up if you allow javascript)
This is a screen shot of this page. The first Gun Guys link (yellow text on black) goes to the Gun Guys website and has the rel=”nofollow” tag. The second link looks normal, and does not have the tag, but points to TheHighRoad web forum.
You can see the comment Sebastian left too. The link to his webpage is a rel=”no follow” one by default.
If you ever get sick of it, you either delete the file and restart (if you created it) or just edit out those two lines if you added them to an existing file.
Related Tags: stupid CSS tricks, rel=”nofollow”, Cascading Style Sheet
Phil Welch Says :
UserContent.css files are also compatible with Safari, the web browser included with Mac OS X. I use one for spam filtering.
2006-05-05 15:59 PermalinkPhil Welch Says :
By which I mean banner ad filtering, but it’s just as bad as spam anyway
2006-05-05 15:59 PermalinkStandard Mischief Says :
Thanks for the info. I think I’ve seen this strategy before:
http://www.mozilla.org/support/firefox/adblock
So if I’m right, you use the cascading style sheet to block any images that are a certain industry standard size, right?
I block ads by using a plug-in (extension) program for Firefox called Adblock. Then I use a RegEx list for adblocking. The list I use is called Filterset.G, and I have another extension to automatically update that.
Furthermore I have the following extra lines in my CSS:
div[id="mouselayer"],}div[id="adstrip"],
div[id*="advert"],
div[id="dropin"],
div[id="dwindow"],
div[id="dcv_EchangeLay"],
div[id="mntl"],
div[id*="popup"],
div[id="quack"],
div[id="splashLayer"],
div[id*="sponsor"],
div[id="yschsec"],
div[class="ovt"],
div[id="fadeinbox"]{
display: none !important;
They seem to block some kinds of ads that Adblock misses. I added the first line to block ads from the public proxy at anony mo use.org (take out extra spaces). Makes it so much nicer to use.
the extension Adblock is cool also because I can click on it and see a list of all the elements that a web page called. It helps to extract deep links to video and audio files, and lets you see what web-counters the site you are visiting is using.
Thanks for the Safari info.
2006-05-05 17:52 PermalinkPhil Welch Says :
I just use the CSS provided at http://www.floppymoose.com/. It’s pretty smart, but understandably not perfect.
2006-05-14 07:15 Permalink