Link to home
Start Free TrialLog in
Avatar of SM17CH
SM17CH

asked on

CSS - If hyperlink is bold, text decoration none.

Hey,
I want to have the underline removed from all hyperlinks that are bold on my website. ie: if a hyperlink is bold there should be no decoration.

Can I do this with CSS?

Regards
Mitch
Avatar of pmagony
pmagony

Try:

a[strong] {
     text-decoration: none;
}

and

a[bold] {
     text-decoration: none;
}
Avatar of SM17CH

ASKER

neither worked :(
Are the hyperlinks bold through CSS or are they bold becuase they are surrounded by strong/bold tags?

a {
    font-weight: bold
}

OR

<strong><a href="#">Link is Bold</a></strong>

?
Avatar of SM17CH

ASKER

HTML page like this:
<strong><a href="#">Link is Bold</a></strong>

Style Sheet looks like this:
a {color:#000066;}
strong {color:#000066;}
a[strong] {text-decoration: none;}
a[bold] { text-decoration: none;}

Using IE7
ASKER CERTIFIED SOLUTION
Avatar of pmagony
pmagony

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
Here's what I did and it worked.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
a {
	font-weight: bold;
}
 
strong a {
	font-weight: normal;
}
-->
</style>
</head>
 
<body>
<a href="#">Bold Link</a><br />
<a href="#">Bold Link, No Attributes</a><br />
<strong><a href="#">Link no Bold</a></strong>
</body>
 
</html>

Open in new window

Avatar of SM17CH

ASKER

Perfect. Thanks alot I appreciate it.
Anytime, thanks for the 'A'.