Relax Breath of Solution.Community tech blog of Sameera Thilakasiri - Consultant UI, UX, RWD Specialist/ Interactive Designer

Just I wanted.. Do you?…

CSS UI Enhancements – Text Selection Highlight Color, Remove Border Outline around links, Attribute-Specific Icons

Posted on April 1, 2011 | 1 Comment

Text Selection Highlight Color
To create a highlight color when text is selected, I use the following code:

/*Mozilla browser selection*/
::-moz-selection{
	background:     #69f;
	color:#fff;
}
/*Other     browsers selection except   IE */
::selection     {
	background:#69F;
	color:#fff;
}

Remove Border Outline around links
I went over some popular websites and was shocked when I saw they had the same problem – an outline appears around the link. A few of the popular websites are listed below with their screen shots.

a:link, a:hover, a:visited{
	outline:none;
}

Attribute-Specific Icons
Do you want to have file icons next to your links? Add PDF icons next to your .PDF links, MS WORD icons next to your .doc links, so on and so forth. This is a great way to make links describe what they’re pointing to.
The code for specifying the attribute icons is:

a[href$='.pdf']{
	padding:0 20px 0 0;
	background-image:url(images/Print.ico);
	background-position:right;
	background-repeat:no-repeat;
}
a[href$='.doc']{
	padding:0         20px 0 0;
	background-image:url(images/docs.ico);
	background-position:right;
	background-repeat:no-repeat;
}

buy cialis phentermine


Author
Sameera Thilakasiri By Sameera Thilakasiri
,is a front-end developer based in Colombo, is a blogger and a lifestyle photographer.
Follow him Twitter and Google+. Check out him.

Comments

One Response to “CSS UI Enhancements – Text Selection Highlight Color, Remove Border Outline around links, Attribute-Specific Icons”

  1. Supun
    September 5th, 2014 @ 4:50 pm

    CSS UI Enhancements – Text Selection Highlight Color, Remove Border Outline around links, Attribute-Specific Icons | Relax Breath of Solution.

Leave a Reply

You must be logged in to post a comment.