Two link types in different colours

Reply

Join Date: Apr 2008
Posts: 41
Reputation: Borderline is an unknown quantity at this point 
Solved Threads: 1
Borderline Borderline is offline Offline
Light Poster

Two link types in different colours

 
0
  #1
Oct 13th, 2008
My navigation system consists of a main bar, which changes colour when a mouse hovers over it. Clicking this link results in a secondary menu appearing, in silver/white.

However, the content background is white, so these link colours aren't suitable. I have tried changing my CSS code so that the link colours are different for items within the content div, but haven't pulled it off as yet. I was hoping someone could point me in the right direction.

Page Code:
HTML and CSS Syntax (Toggle Plain Text)
  1. <head>
  2. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  3. <title>Further Flight</title>
  4. <link rel="stylesheet" type="text/css" href="http://www.further-flight.co.uk/style/20080820.css"/>
  5. </head>
  6.  
  7. <body>
  8.  
  9. <div id="secondary"><?php include($_SERVER['DOCUMENT_ROOT'].'/style/secondary_previews.php');?></div>
  10. <div id="header"><?php include($_SERVER['DOCUMENT_ROOT'].'/style/header.php');?></div>
  11. <div id="logo"><?php include($_SERVER['DOCUMENT_ROOT'].'/style/logo.php');?></div>
  12. <div id="navigation"><?php include($_SERVER['DOCUMENT_ROOT'].'/style/main.php');?></div>
  13.  
  14. <div id="content">
  15. <h2>Overview of Jackpot Previews</h2>
  16.  
  17. <p>
  18. <a class="content">
  19.  
  20. Our resident columnist Pip, from Lodgehill Stables, selects three races a night to preview. As soon as racing
  21. begins, we hope to bring this popular feature back to your screens!
  22.  
  23. </p></a>
  24. </div>

CSS Code:
HTML and CSS Syntax (Toggle Plain Text)
  1.  
  2. /*------ BASIC LAYOUT ------*/
  3.  
  4. #secondary{
  5. margin: 0px 0px 0px 0px;
  6. width: 100%;
  7. height: 15px;
  8. font: 0.7em arial, verdana, sans-serif;
  9. background-color: #494949;
  10. padding: 5px 0px 5px 0px;
  11. text-indent: 10px;
  12. color: silver;
  13. }
  14.  
  15. #logo{
  16. height: 80px;
  17. background-color: #000000;
  18. z-index: 1;
  19. }
  20.  
  21. #header{
  22. position: absolute;
  23. top: 20px;
  24. right: 50px;
  25. text-align: right;
  26. z-index: 2;
  27. }
  28.  
  29. #footer{
  30. background: url(/images/footer.png) repeat-x;
  31. text-align: center;
  32. padding: 10px 0;
  33. font: bold 0.8em arial, verdana, sans-serif;
  34. text-align: center;
  35. color: #FFFFFF;
  36. border: 1px solid #000000;
  37. }
  38.  
  39.  
  40. /*------ ELEMENTS AND TAGS ------*/
  41.  
  42. a:link {
  43. color: white;
  44. text-decoration:none;
  45. }
  46.  
  47. a:visited {
  48. color: silver;
  49. text-decoration:none;
  50. }
  51.  
  52. a:hover {
  53. color:silver;
  54. text-decoration:bold;
  55. }
  56.  
  57. body {
  58. background-image: url("/images/20080820_back1.png");
  59. background-repeat: repeat;
  60. }
  61.  
  62. h1 {
  63. color: #FFFFFF;
  64. font: 2em arial, verdana, sans-serif;
  65. letter-spacing: 2px;
  66. }
  67.  
  68. h2 {
  69. color: #C0C0C0;
  70. font: 0.9em arial, verdana, sans-serif;
  71. }
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80. /*------ CONTENT BOXES ------*/
  81.  
  82. div#content {
  83. margin-top: 30px;
  84. padding: 20px;
  85. border: 1px solid #000000;
  86. background: #FFFFFF;
  87. font: 0.8em arial, verdana, sans-serif;
  88. }
  89.  
  90. div#content h2 {
  91. position: relative;
  92. float: left;
  93. margin: -38px 0 15px 0;
  94. padding: 8px;
  95. border: 1px solid #000000;
  96. background: black url(/images/blockactive.gif) center center repeat-x;
  97. font: bold 1em arial, verdana, sans-serif;
  98. color: #FFFFFF;
  99. }
  100.  
  101. div#content h1 {
  102. font: bold 0.8em arial, verdana, sans-serif;
  103. color: #000000;
  104. }
  105.  
  106. div#content p {
  107. clear: left;
  108. color: #000000;
  109. text-align: justify;
  110. }
  111.  
  112. a.content:link {
  113. color: blue;
  114. text-decoration:none;
  115. }
  116.  
  117. a.content:visited {
  118. color: purple;
  119. text-decoration:none;
  120. }
  121.  
  122. a.content:hover {
  123. color:red;
  124. text-decoration:bold;
  125. }
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 6
Reputation: ada_a is an unknown quantity at this point 
Solved Threads: 0
ada_a ada_a is offline Offline
Newbie Poster

Re: Two link types in different colours

 
0
  #2
Oct 13th, 2008
Oops, ignore my reply. I wasn't able to answer your question x_X
Last edited by ada_a; Oct 13th, 2008 at 12:12 pm.
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,210
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 164
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: Two link types in different colours

 
0
  #3
Oct 15th, 2008
Browsers have accessibility settings to disable changing the colors of links. Check your settings.

Link color metastyles are global in nature.
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the HTML and CSS Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC