Solved

Need help with CCS link colour in DIV

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

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 9

Expert Comment

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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

"I want to put my photos online, but I don't want them stolen.  What settings should I use?" When You Put Photos Online First and foremost, any digital file published on the WWW can be copied, stored, modified, retransmitted, etc.  Remember Naps…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
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…

746 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now