Link to home
Start Free TrialLog in
Avatar of hankknight
hankknightFlag for Canada

asked on

Add !important to all css attributes for a:*{}

Using regex I want to add !important to the end of each attributes for all "a" items.

For example,
   a:link {color: red}
Should become:
   a:link {color: red !important}

and

#divID p, #divID a:link, #divID a:hover {color: red; text-decoration: none; font-weight: bold;}

Should become:

#divID p, #divID a:link, #divID a:hover {color: red !important; text-decoration: none !important; font-weight: bold !important;}

This should only be done if  
       a:
is before { and }


a:link { color: white  font-size: 14px; font-family: Helvetica; text-decoration: none }
A:visited {
	color: white  
	font-size: 14px; 
	font-family: Helvetica; 
	text-decoration: none  }
A:active { color: #f4cd03  font-size: 14px; font-family: Helvetica; text-decoration: none  !important }
A:hover {
color: #f4cd03  font-size: 14px; font-family: Helvetica; 
text-decoration: none  }

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of ddrudik
ddrudik
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the question and the points.