<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>tlrobinson.net blog &#187; CSS</title>
	<atom:link href="http://tlrobinson.net/blog/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://tlrobinson.net/blog</link>
	<description></description>
	<lastBuildDate>Mon, 06 Apr 2009 08:37:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Using user stylesheets to highlight links to PDFs or other media, rel=&quot;nofollow&quot;, etc</title>
		<link>http://tlrobinson.net/blog/2008/03/using-user-stylesheets-to-highlight-links-to-pdfs-or-other-media-relnofollow-etc/</link>
		<comments>http://tlrobinson.net/blog/2008/03/using-user-stylesheets-to-highlight-links-to-pdfs-or-other-media-relnofollow-etc/#comments</comments>
		<pubDate>Tue, 25 Mar 2008 08:35:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://tlrobinson.net/blog/?p=37</guid>
		<description><![CDATA[Browsers allow you to define your own stylesheet that&#8217;s applied to every page you visit. For the longest time I&#8217;ve wondered why anyone would ever want this feature. I figured it would be useful for people with poor vision or &#8230; <a href="http://tlrobinson.net/blog/2008/03/using-user-stylesheets-to-highlight-links-to-pdfs-or-other-media-relnofollow-etc/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Browsers allow you to define your own stylesheet that&#8217;s applied to every page you visit. For the longest time I&#8217;ve wondered why anyone would ever want this feature. I figured it would be useful for people with poor vision or other disabilities and that was about it.</p>
<p>But combined with some neat features of CSS, one can come up with interesting uses of user stylesheets. Consider the following:</p>
<p>    a[rel~="nofollow"] {<br />
        text-shadow: rgba(255,0,0,0.25) 1px 1px 1px;<br />
    }</p>
<p>This rule uses the partial attribute value selector to give all hyperlinks with the <a href="http://en.wikipedia.org/wiki/Nofollow" style="text-shadow: rgba(255,0,0,0.25) 1px 1px 1px;">rel=&#8221;nofollow&#8221;</a> attribute a slight red shadow (like the preceding link, if your browser supports text-shadow).</p>
<p><a href="http://tlrobinson.net/misc/newsyc.png"><img src="http://tlrobinson.net/misc/newsyc.png" style="width: 449px; height: 309px;"></a></p>
<p>Why would you want this? Well, for me, pure curiosity. But SEOs or spammers may find it enlightening though.</p>
<p>For example, the first thing I noticed was that on the <a href="http://news.ycombinator.com">Hacker News</a> homepage links to external sites newer than 3 or 4 hours have the nofollow attribute, but older ones do not &#8211; clearly a spam deterrent.</p>
<p>There are many other useful and interesting scenarios. Say you want to highlight all PDF or MP3 links (&#8220;$=&#8221; matches the end of an attribute):</p>
<p>    a[href$=.pdf], a[href$=.mp3] {<br />
        text-shadow: rgba(0,255,0,0.25) 1px 1px 1px;<br />
    }</p>
<p>Or email links (&#8220;^=&#8221; matches the beginning of an attribute):</p>
<p>    a[href^=mailto] {<br />
        text-shadow: rgba(0,0,255,0.25) 1px 1px 1px;<br />
    }</p>
<p>Note that I used text shadows, but anything styleable by CSS is fair game.</p>
<p>With April fools day approaching, one could imagine other creative uses. I&#8217;ll leave that as an exercise to the reader.</p>
]]></content:encoded>
			<wfw:commentRss>http://tlrobinson.net/blog/2008/03/using-user-stylesheets-to-highlight-links-to-pdfs-or-other-media-relnofollow-etc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

