Solved

Need help with CCS link colour in DIV

Posted on 2013-05-30
3
156 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
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
Ishaan Rawat earned 500 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…

825 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