Solved

Need help with CCS link colour in DIV

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
css, html 6 51
HTML and CSS for a complex page 20 61
Wordpress theme to easily (hopefully!) make this type of site 1 36
Syntax Error 2 46
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
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 position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
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).

895 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

12 Experts available now in Live!

Get 1:1 Help Now