Solved

CSS Target a class inside a link tag

Posted on 2014-02-14
1
490 Views
Last Modified: 2014-02-14
I have the following HTML code
<div class="arc-article">
<div id="BehindScenes"><a href="http://digital.faithtoday.ca/faithtoday/20140102#pg7">
<h3>Behind<span class="text-maroon">TheScenes</span></h3>...

Open in new window


and the following CSS code

.arc-article a:visited,
.arc-article a:link,
.arc-article a:active {
	text-decoration: none;
	color: #000;
}

.arc-article a:hover{
	text-decoration: none;
	color: #666;
}

.text-maroon {
	color: #9b373f;
}

Open in new window


When I hover, the h3 tag gets the correct #666 color, but I want the span tag to also get the hover over affect.  I understand why it's happening, but how do I target the text-maroon class to hover the same #666 color?

How do I target span class

http://www.faithtoday.ca/20140102
0
Comment
Question by:dauyeung
1 Comment
 
LVL 8

Accepted Solution

by:
Adrian Crabtree earned 500 total points
ID: 39860274
Hi dauyeung, if you target the span that's within the anchor, you should be able to change the colors. I have set up an example here: http://jsfiddle.net/Lxck3/

.arc-article a:hover,
.arc-article a:hover span {
	text-decoration: none;
	color: #666;
}

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now