This is a discussion on How can I have two sets of links with different colors? within the HTML, CSS and Javascript Coding Techniques forums, part of the Web Development category; How can I have two sets of links with different colors?...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| How can I have two sets of links with different colors? |
|
#2
| |||
| |||
| You can suggest this presentation in a style sheet. First, specify colors for normal links, like this: a:link {color: blue; background: white} a:visited {color: purple; background: white} a:active {color: red; background: white} Next, identify the links that you want to have different colors. You can use the CLASS attribute in your HTML, like this: <a class="example1" href="[url]">[link text]</a> Then, in your style sheet, use a selector for links with this CLASS attribute, like this: a.example1:link {color: yellow; background: black} a.example1:visited {color: white; background: black} a.example1:active {color: red; background: black} Alternatively, you can identify an element that contains the links that you want to have different colors, like this: <div class="example2">... <a href="[url]">[link text]</a>... <a href="[url]">[link text]</a>... <a href="[url]">[link text]</a>... </div> Then, in your style sheet, use a selector for links in this containing element, like this: .example2 a:link {color: yellow; background: black} .example2 a:visited {color: white; background: black} .example2 a:active {color: red; background: black} |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MySQL supports indian language character sets | priyan | Database Support | 17 | 01-11-2010 12:25 AM |
| Manipulating scrollbar colors using CSS and JavaScript | santhakumar | HTML, CSS and Javascript Coding Techniques | 1 | 11-27-2007 05:55 AM |
| Find similar Colors | Balasubramanian.S | C# Programming | 2 | 09-19-2007 08:40 AM |
| Why the colors on my page look different when viewed on a Mac and a PC? | oxygen | HTML, CSS and Javascript Coding Techniques | 1 | 07-27-2007 02:57 AM |
| Colors and fonts | sanray316 | Web Design Help | 4 | 03-25-2007 09:29 PM |
Our Partners |