Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

Need help with CCS link colour in DIV

Posted on 2013-05-30
3
Medium Priority
?
173 Views
1 Endorsement
Last Modified: 2013-05-30
I have all links on my page within <div id="main_container"> set to red, however I would like to over rule this with white links and red hover if links are H2 tags?

<html>
<head>
<style type="text/css">

body{
	background-color: #000;	
}

#main_container a:link, #main_container a:active{
  text-decoration: none;
  color: #FF0033;
} 
#main_container a:hover{
  text-decoration: none;
    color: #fff;
}
#main_container a:visited{
  text-decoration: none;
  color: #FF0033;
}


h2{
   font-family: Verdana, Geneva, Arial, Helvetica-Normal, serif;
   color: #f3f3f3; 
   font-weight: normal;
   font-size: 20px;
}

</style>

</head>

<body>
</body>

<div id="main_container">


<a href="">TEST LINK</a>

<h2><a href="">TEST LINK</a></h2>

</div>

Open in new window

1
Comment
Question by:sabecs
[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
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
Ishaan Rawat earned 2000 total points
ID: 39207023
add this to your css...


h2 a{
color: white !important;
}
h2 a:hover{
color: red !important;
}

Open in new window

0
 

Author Closing Comment

by:sabecs
ID: 39207120
Thanks Ishaan, that is perfect..
0
 
LVL 10

Expert Comment

by:Ishaan Rawat
ID: 39207255
Your welcome...
0

Featured Post

Technology Partners: 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

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

647 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