Solved

CSS Target a class inside a link tag

Posted on 2014-02-14
1
488 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

744 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

12 Experts available now in Live!

Get 1:1 Help Now