Solved

CSS Target a class inside a link tag

Posted on 2014-02-14
1
498 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
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 embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

749 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