externalI love the feature in the browsers that supports CSS 3 like Mozilla and Safari. But as always IE has the lag of this feature. So now I have created a simple Mootools that styles all the off-site links so there will be no difference using IE, Mozilla, Safari, Chrome and all other, javascript supported, browsers.

The html

Read your email!

The css

.external {
	padding-left: 16px;
	background: url('images/external.gif') center left no-repeat;
	}

The javascript

window.addEvent('domready',function() {
	$$('a').each(function(a){
		if(a.target && a.target.test(/^_blank/i)){
			a.addClass('external');
		}
	});
});

The result is like this example! Feel free to style your external links to your own preference.

Related Posts

Leave a Comment

Get your own Gravatar!
Your email will never be published!

Notify me of followup comments via e-mail

Top of Page