Solved

Need help with CCS link colour in DIV

Posted on 2013-05-30
3
161 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 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

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

Unordered lists (HTML ul tags) are very handy to create menus of all types, shapes and sizes.  All it takes is a little knowledge of CSS and the possibilities are endless. First off, you should know the general format for menus created using the …
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
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…
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).

707 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