Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

CSS Target a class inside a link tag

Posted on 2014-02-14
1
Medium Priority
?
514 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 2000 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 does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
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 customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…

636 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