The CSS3 attribute selectors in action

a[target="_blank"]{border-bottom:2px double green;}
a[href^="http://"]{background-image:url(./out.gif);background-repeat:no-repeat;background-position:right center;padding-right:10px;}
a[href*="hbird"]{background-image:url(./hb.gif);background-repeat:no-repeat;background-position:right center;padding-right:13px;}

In the below given paragraph the green underlined links are links which will open in new window. We are using the [target="_blank"] selector on link tags to make this selective styling. Then we are identifying all external links by using the [attr^='valuestring'] selector to pick all links that starts with "http://" and are applying a small icon to them.

One of the best-preserved ancient cities on the Mediterranean) Ephesus is Turkey's showpiece of Aegean archaeology. This is link 1 with a blank target Although it is 3 miles away from the sea today, Ephesus was once one of the wealthiest trading port cities of the Greco-Roman era, ideally situated between the Near East and the Mediterranean ports of the West.This is link 2 with a blank target

Settled as early as l00O B.C.by the Ionians, its extensive and impressive ruins testify to its ancient role as capital of the Roman province of Asia-in the time of Augustus Caesar, - An external link - it was the second-largest city in the eastern Mediterranean, after Alexandria.This is link 3 with out any target

Today, a mile-long marble-paved street grooved by chariot wheels leads - This is another external link - past partially recon- structed buildings, such as the Great Theater (which held 25,000 spectators) and the beauti- ful two-story Celsus Library @uilt in A.D. 135), one of the largest libraries and most graceful surviving buildings of antiquity.This is an external link, but to our own website

Excerpt taken from 1000 Places to visit before you Die.