Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Specific DIV Hyperlink Color

Posted on 2016-10-10
1
Medium Priority
?
87 Views
Last Modified: 2016-10-12
Hi,
I would like to have a completely unique Hyperlink color for a page as compared to the rest of the website.
So for example, if the active hyperlink color for the website is grey, I would like the active hyperlink color on one particular page to be red.

Can someone explain how this can be done please?


Thanks!
0
Comment
Question by:canu
[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
1 Comment
 
LVL 44

Accepted Solution

by:
zephyr_hex (Megan) earned 2000 total points
ID: 41837552
Add a class to the hyperlinks on the "special" page, and then use css to target the class and specify the link color.

HTML
<a href="www.google.com" class="uniqueLink">Google</a>

Open in new window


CSS
.uniqueLink {
  color: red;
}

.uniqueLink:visited {
  color: green;
}

Open in new window


Here is a Fiddle Demo.

If you have a lot of links on the page, it may be more efficient to use a class on a container (whatever contains all of the links).  Here's an example of that approach

HTML
<div class="uniqueLink container">
     <a href="www.google.com">Google</a>
     <a href="www.yahoo.com">Yahoo</a>
</div>

Open in new window


CSS
.uniqueLink > a {
  color: red;
}

.uniqueLink > a:visited {
  color: green;
}

Open in new window


Fiddle Demo.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

730 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